Andrew Zonenberg on Nostr: This is how I do all of my embedded stuff, how else would you put them at predictable ...
This is how I do all of my embedded stuff, how else would you put them at predictable locations?
For example on the PicoRV32 platform I'm playing with now I have...
volatile APB_GPIO GPIOA __attribute__((section(".gpioa")));
volatile APB_Timer TIM1 __attribute__((section(".tim1")));
volatile APB_UART UART1 __attribute__((section(".uart1")));
and then in the linker script
.sfr (NOLOAD):
{
. = ALIGN(1024);
KEEP(*(.gpioa))
. = ALIGN(1024);
KEEP(*(.tim1))
. = ALIGN(1024);
KEEP(*(.uart1))
. = ALIGN(1024);
KEEP(*(.spi1))
. = ALIGN(1024);
KEEP(*(.count1))
. = ALIGN(1024);
KEEP(*(.count2))
. = ALIGN(1024);
KEEP(*(.devinfo))
} > APB
For example on the PicoRV32 platform I'm playing with now I have...
volatile APB_GPIO GPIOA __attribute__((section(".gpioa")));
volatile APB_Timer TIM1 __attribute__((section(".tim1")));
volatile APB_UART UART1 __attribute__((section(".uart1")));
and then in the linker script
.sfr (NOLOAD):
{
. = ALIGN(1024);
KEEP(*(.gpioa))
. = ALIGN(1024);
KEEP(*(.tim1))
. = ALIGN(1024);
KEEP(*(.uart1))
. = ALIGN(1024);
KEEP(*(.spi1))
. = ALIGN(1024);
KEEP(*(.count1))
. = ALIGN(1024);
KEEP(*(.count2))
. = ALIGN(1024);
KEEP(*(.devinfo))
} > APB