/*ENTRY(reset_handler)*/
/* End of RAM / Start of stack */
/* (4KB SRAM) */
-_estack = 0x20262144;
/* epsilon stuff */
STACK_SIZE = 32K;
*(.rodata.*)
} >FLASH
+ .init_array : {
+ . = ALIGN(4);
+ _init_array_start = .;
+ KEEP (*(.init_array*))
+ _init_array_end = .;
+ } >FLASH
+
/* The 'data' section is space set aside in RAM for
* things like variables, which can change. */
.data : {
#include "vector_table.h"
#include <stddef.h>
+#include <stdint.h>
+#include "device/stm32f730xx.h"
+
+#define LED_PIN (4) // PC0
typedef void (*cxx_constructor)();
size_t bssSectionLength = (&_bss_section_end_ram - &_bss_section_start_ram);
memset_custom(&_bss_section_start_ram, 0, bssSectionLength);
+ // Enable the GPIOa and GPIOC peripheral in RCC.
+ RCC->AHB1ENR |= RCC_AHB1ENR_GPIOBEN ;
+
+ // C0 is connected to the LED.
+ // It should be set to push-pull low-speed output.
+ GPIOB->MODER &= ~(0x3 << (LED_PIN*2));
+ GPIOB->MODER |= (0x1 << (LED_PIN*2));
+ GPIOB->OTYPER &= ~(1 << LED_PIN);
+
+ GPIOB->ODR = (1 << LED_PIN);
+
while (0)
{
- /* code */
+ GPIOB->ODR = (1 << LED_PIN);
}
}
\ No newline at end of file
#include "vector_table.h"
-extern const void * _estack;
+extern const void * _stack_start;
/* Interrupt Service Routines are void->void functions */
typedef void(*ISR)(void);
__attribute__((section(".isr_vector_table")))
__attribute__((used))
= {
- (ISR)&_estack, // Stack start
+ (ISR)&_stack_start, // Stack start
start, // Reset service routine,
0, // NMI service routine,
0, // HardFault service routine,