8 years, 3 months ago.

Linkder File for TOOL Chain ARM GCC for STM32F401RE

Hi,

I need to understand a line of code in the linker file of STM32F4 to implement similar to it for my target Tiva C, since both RAM addresses start at 0x2000000

The line is

RAM (rwx)  : ORIGIN = 0x20000198, LENGTH = 128k - 0x198

The question is: why did he begin the ram from this particular address ? ( I am guessing that it's because mbed needs to offset the vector table to the beginning of the RAM) if that is true, how can I calculate this offset for 154 vectors for my Target

1 Answer

8 years, 3 months ago.

You have 154 vectors, each vector is 4 bytes (32-bit pointer), so total is 616 bytes, is 268 hex. F401 apparantly has 102 vectors.

Accepted Answer

So, should I offset the address in the linker file by 268 to make space for the vector table?

posted by Mohamed Saleh 31 Jul 2016

By the way, From the datasheet of F401, MCU has 98 (16+82) vectors. So According to you, this should be 188 not 198. So Still the question is on.. why is it 198?

posted by Mohamed Saleh 31 Jul 2016

Yes offsetting it by 268 should do the job.

Also for the F401 either I am missing something here, or they have 198 lines to the CPU of which only 188 are used, but they set it to 198 anyway, or they simply made a calculation error, wouldn't be the first one in the mbed lib ;).

posted by Erik - 31 Jul 2016