The procedure for loading code into flash memory

I am new to Embedded field. I have doubts about downloading files in hexadecimal format: Since the output of the linker and locator is a binary file with various sections like .text, .bss, .data, etc., .text is in Flash, .bss goes into RAM .data goes into RAM ... so my question is what

  • both .bss and .data are written to RAM since I use the FLASH Loader to write my program to flash.
  • Is there any index type of thing in the final binary that distinguishes between .text and .bss segments.
  • Is there any utility in the linker / locator that converts our simple binary to hex.
  • How can I distinguish between .text and .bss from the contents of a hex file?

Thanks in advance. Please, help.

+5
source share
3 answers

1.) how are .bss and .data written to RAM since I use FLASH Loader to write my program to flash?

Code, persistent data, and initialized data are written to FLASH. During startup, initialized data is copied to bss during startup. Permanent data is usually accessed directly (you declare it with the "const" keyword).

2.) Is there any index type of thing in the final binary that distinguishes between .text and .bss segments?

, "" . . , , , . GCC .elf.

"link script" . , .

3.) - /, ?

"objcopy" , Intel-hex. . "Objdump".

4.) .text .bss ?

. GCC " " , bss. script.

Intel-hex: http://en.wikipedia.org/wiki/Intel_HEX

GCC: http://gcc.gnu.org/onlinedocs/

+5

( ) Flash .

, ( ), .bss .data etc, C. C, C main(), .bss .data -. :

  • .bss .
  • .data - .
    • ( Flash, , ).

. C Flash RAM .

C :

  • ( )
  • , ​​ , , , ..
+4

, .

( 16 128 /NVRAM ) NVRAM. , , , , . , , .

, NVRAM, , , , NVRAM ( ) NVRAM .

:

2) , . . . .

3) , . , U-Boot kermit .

4) . 2).

+1

All Articles