CMake building RUI3 - wrong startup address

I was developing a bare-metal firmware for RAK3172 with STM32CubeWL starting with a CubeMX generated template.
I realized, RUI3 works a lot better (missed downlinks with CubeMX firmware) and would simplify a lot of things as I could make use of Arduino libraries etc.
Still, I want to use my IDE of choice (CLion) with debugger and my probe (STLink/SWD or CMSIS-DAP Probe).

Setting up the CMake project with GitHub - a9183756-gh/Arduino-CMake-Toolchain: CMake toolchain for all Arduino compatible boards worked fine, also the binaries work when flashing with STM32CubeProgrammer and selecting “run after programming”.

Yet if I just boot up the MCU, it seems to be jumping to 0x0, whereas the correct startup vector should be somewhere here:

Remote target using gdb-specific protocol:
Sensor_RUI3.elf’, file type elf32-littlearm.
Entry point: 0x8007740
0x08006000 - 0x08006138 is .isr_vector
0x08006140 - 0x0801e1b0 is .text
0x0801e1b0 - 0x0801f4c0 is .rodata
0x0801f4c0 - 0x0801f4c8 is .ARM
0x0801f4c8 - 0x0801f4c8 is .preinit_array
0x0801f4c8 - 0x0801f4d8 is .init_array
0x0801f4d8 - 0x0801f4e0 is .fini_array
0x20000000 - 0x200004b0 is .data
0x200004b0 - 0x200061b0 is .bss
0x200061b0 - 0x20009fb0 is ._user_heap_stack

If I exchange the content of “flash_stm32wle5xx.ld” linker script with my bare-metal one, the main() of rui_inner_main.c gets called, but crashes at initializing the RTC…

My suspicion is this is because RUI3 is expecting some kind of custom bootloader I do not deploy?
Is there anything else I could try?

Hi @surumadurum ,

The code of RUI3 is open already. I am not sure if you saw it already but it is here - GitHub - RAKWireless/RAK-STM32-RUI: RUI3 BSP for RAK3172 modules

There is RUI3 bootloader that manage the uploading of RUI3 compiled codes. This is on top of the internal STM32 bootloader used on STM32Cubeprogrammer.

Looking on our RUI3 open source code linker file, this is the memory definition.

Thanks for your reply @carlrowan!

I have seen and replaced the file with the CubeMX generated linker file, which compiles and starts running the init code, but then just hangs at some memory-address which is not associated with code in the debugger.

Would you mind sharing your development setup?
(Or are there even instructions, I guess there are a lot of people who love RUI, but would like to take ownership about the whole source involved)

My other thought was: The bootloader does not do any magic initialisation without the application code cannot run, right?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.