mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
Fixes
This commit is contained in:
46
boot/crt0.c
46
boot/crt0.c
@@ -10,7 +10,14 @@ extern const void * _bss_section_end_ram;
|
||||
extern const void * _stack_start;
|
||||
extern const void * _stack_end;
|
||||
|
||||
void _start(void);
|
||||
void _ResetServiceRoutine(void);
|
||||
void _NMIServiceRoutine(void);
|
||||
void _HardFaultServiceRoutine(void);
|
||||
void _MemManageServiceRoutine(void);
|
||||
void _BusFaultServiceRoutine(void);
|
||||
void _SVCallServiceRoutine(void);
|
||||
void _PendSVServiceRoutine(void);
|
||||
void _SystickServiceRoutine(void);
|
||||
|
||||
/* Interrupt Service Routines are void->void functions */
|
||||
typedef void(*ISR)(void);
|
||||
@@ -27,15 +34,24 @@ ISR InitialisationVector[INITIALISATION_VECTOR_SIZE]
|
||||
__attribute__((section(".isr_vector_table")))
|
||||
= {
|
||||
(ISR)&_stack_start,
|
||||
_start,
|
||||
0,
|
||||
0,
|
||||
_ResetServiceRoutine,
|
||||
_NMIServiceRoutine,
|
||||
_HardFaultServiceRoutine,
|
||||
_MemManageServiceRoutine,
|
||||
_BusFaultServiceRoutine,
|
||||
0, // UsageFault
|
||||
0, // Reserved
|
||||
_SVCallServiceRoutine,
|
||||
0, // Debug Monitor
|
||||
_PendSVServiceRoutine, // PendSV
|
||||
_SystickServiceRoutine, // Systick
|
||||
0
|
||||
};
|
||||
|
||||
|
||||
int main(int argc, char * argv[]);
|
||||
|
||||
void _start(void) {
|
||||
void _ResetServiceRoutine(void) {
|
||||
// This is where execution starts after reset.
|
||||
// Many things are not initialized yet so the code here has to pay attention.
|
||||
|
||||
@@ -54,3 +70,23 @@ void _start(void) {
|
||||
|
||||
main(0, 0x0);
|
||||
}
|
||||
|
||||
void _NMIServiceRoutine(void) {
|
||||
while (1) {
|
||||
}
|
||||
}
|
||||
|
||||
void _HardFaultServiceRoutine(void) {
|
||||
while (1) {
|
||||
}
|
||||
}
|
||||
|
||||
void _MemManageServiceRoutine(void) {
|
||||
while (1) {
|
||||
}
|
||||
}
|
||||
|
||||
void _BusFaultServiceRoutine(void) {
|
||||
while (1) {
|
||||
}
|
||||
}
|
||||
|
||||
12
external/FreeRTOSConfig.h
vendored
12
external/FreeRTOSConfig.h
vendored
@@ -158,13 +158,15 @@ See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
|
||||
|
||||
/* Normal assert() semantics without relying on the provision of an assert.h
|
||||
header file. */
|
||||
#define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); }
|
||||
|
||||
//#define configASSERT( x ) if( ( x ) == 0 ) vAssertCalled( __FILE__, __LINE__ )
|
||||
#define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); }
|
||||
|
||||
|
||||
/* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS
|
||||
standard names. */
|
||||
//#define vPortSVCHandler SVC_Handler
|
||||
//#define xPortPendSVHandler PendSV_Handler
|
||||
//#define xPortSysTickHandler SysTick_Handler
|
||||
#define vPortSVCHandler _SVCallServiceRoutine
|
||||
#define xPortPendSVHandler _PendSVServiceRoutine
|
||||
#define xPortSysTickHandler _SystickServiceRoutine
|
||||
|
||||
#endif /* FREERTOS_CONFIG_H */
|
||||
|
||||
|
||||
2
external/NEWLIB.txt
vendored
Normal file
2
external/NEWLIB.txt
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
- Using memcpy and memset
|
||||
- using <string.h>, <stdlib.h>, and <stdint.h>
|
||||
42
src/freertos_blinky.c
Normal file
42
src/freertos_blinky.c
Normal file
@@ -0,0 +1,42 @@
|
||||
#include <registers.h>
|
||||
#include <FreeRTOS.h>
|
||||
#include <task.h>
|
||||
#include <timers.h>
|
||||
#include <semphr.h>
|
||||
|
||||
int main(int argc, char * argv[]) {
|
||||
|
||||
vTaskStartScheduler();
|
||||
|
||||
// We want to blink LEDs connected to GPIO pin G13 and G14
|
||||
// (this is documented in our board's PDF)
|
||||
//
|
||||
// GPIO are grouped by letter, and GPIO "G" live on the "AHB1" bus
|
||||
// (this is documented in the STM32F4 reference mnual, page 65)
|
||||
|
||||
// Step 1 : Enable clock in RCC_AHBxENR
|
||||
RCC_AHB1ENR->GPIOGEN = 1;
|
||||
|
||||
|
||||
// Step 2 : Configure the GPIO pin to "general purpose output
|
||||
GPIO_MODER(GPIOG)->MODER13 = GPIO_MODE_OUTPUT;
|
||||
GPIO_MODER(GPIOG)->MODER14 = GPIO_MODE_OUTPUT;
|
||||
|
||||
// Per doc, the output is push-pull by default (yay)
|
||||
// And we should also set the output speed, but really
|
||||
// we don't care (we're doing something super slow)
|
||||
|
||||
long delay = 50000;
|
||||
|
||||
while (1) {
|
||||
GPIO_ODR(GPIOG)->ODR13 = 0;
|
||||
GPIO_ODR(GPIOG)->ODR14 = 1;
|
||||
|
||||
// sleep(delay);
|
||||
|
||||
GPIO_ODR(GPIOG)->ODR13 = 1;
|
||||
GPIO_ODR(GPIOG)->ODR14 = 0;
|
||||
|
||||
// sleep(delay);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user