cancel
Showing results for 
Search instead for 
Did you mean: 

Error linker script

q_
Associate II
Posted on November 03, 2014 at 12:26

Hello,

I'm working on STM32f with ARM GCC and i'm trying to use linker script as below:

*.c

const TByte Variable[SIZE_OF_VECTOR] __attribute__ (section(''.md5''));

*.ld

MEMORY

{

 md5rom (rx)          : ORIGIN = 0x0803FF00, LENGTH = 16   /* 16   Bytes  */

..

}

 .md5 : {

  *(.md5) /* MD5 Value */

  . = ALIGN(4);

 } >md5rom

*.bin

0003FED4   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ............................................

0003FF00   70 EC 28 8E  A3 84 A2 92  79 1D 33 2D  2B F4 43 DF                                                                                             p.(.....y.3-+.C.

0003FF2C

But when i use GDB with Jtag Link i have just 0xFF 0xFF .... at --0x3FF00 addr.

however when i dump the flash i don't have OxFF :

0003FED4   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ............................................

0003FF00   70 EC 28 8E  A3 84 A2 92  79 1D 33 2D  2B F4 43 DF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  p.(.....y.3-+.C.............................

0003FF2C   FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  ............................................

 

Have you an idea of ​​why i have 0xFF in Variable[SIZE_OF_VECTOR]???

Thank you
6 REPLIES 6
q_
Associate II
Posted on November 03, 2014 at 18:06

q_
Associate II
Posted on November 03, 2014 at 18:08

I think my problem comes from the protection of the flash. How can I remove these flash protection?

FLASH_ACR 0x4002 2000 - 0x4002 2003 4

FLASH_KEYR 0x4002 2004 - 0x4002 2007 4

FLASH_OPTKEYR 0x4002 2008 - 0x4002 200B 4

FLASH_SR 0x4002 200C - 0x4002 200F 4

FLASH_CR 0x4002 2010 - 0x4002 2013 4

FLASH_AR 0x4002 2014 - 0x4002 2017 4

Reserved0x4002 2018 - 0x4002 201B 4

FLASH_OBR 0x4002 201C - 0x4002 201F 4

FLASH_WRPR 0x4002 2020 - 0x4002 2023 4

thank you
Posted on November 03, 2014 at 22:43

And what does the application code see at 0x0803FF00 ?

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
q_
Associate II
Posted on November 04, 2014 at 09:29

Thank you for your answer, the application code see 0xFF at 0x0803FF00 instead of my MD5. When i write my md5 with ''flash fillb 0x0803ff00 117 1, ...'', Variable[SIZE_OF_VECTOR] have my MD5 but GDB don't work. I think that when i used ''flash fillb 0x0803ff00 117 1'', the JTAG disable the flash protection and i can read at 0x0803FF00. How can I remove these flash protection? or why i don't read at 0x0803FF00 when i flash the STM32 with :

init

reset halt

stm32f1x mass_erase 0

flash probe 0

flash write_image main.bin 0x08000000

q_
Associate II
Posted on November 12, 2014 at 10:13

Hi

How to ''Program the correct RDP code 0x00A5 to unprotect the memory.''

Thank you

Posted on November 12, 2014 at 19:19

What processor, exactly, are we talking about here?

I'm sure not why RDP would be enabled in the first place, it isn't by default.

If stuff isn't in memory where you expect it to be you need to look at what the tools are outputting, and how the flashing programs are using that. I'd look at the ELF file, and how the load regions are organized.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..