section define

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
xiaotuzi_bengda
Level 1
Level 1
First reply posted First question asked Welcome!

Hello,

Now I am using "cy8c6xx7". When i add code  in "startup_psoc6_01_cm4.S"  as follows:

.section .debug_version /*define only, not used*/

I see that the hex file generated after build had been changed from the address 0x10092C24 to the address 0x10092F34.

I didn't use the address between 0x10092C24 and 0x10092F34, 

can you tell me the reason why after adding ".section .debug_version", the content of address 0x10092C24 ~ 0x10092F34 had been changed?

Follows is my build information.

------------------------------------------------------------------------------------

----------------------------------------------------
| Section Name | Address | Size |
----------------------------------------------------
| .bootloader | 0x10000000 | 70144 |
| .boot_judge1 | 0x10011200 | 8 |
| .boot_judge2 | 0x10011208 | 8 |
| .version | 0x10011210 | 12 |
| .upd_version | 0x10011220 | 4 |
| .text | 0x10011400 | 525136 |
| PROGBITS | 0x10091750 | 252 |
| .boot_judge3 | 0x100ffff0 | 8 |
| .ARM.exidx | 0x1009184c | 8 |
| .copy.table | 0x10091854 | 24 |
| .zero.table | 0x1009186c | 8 |
| .data | 0x0800028c | 5828 |
| backup | 0x08001950 | 7 |
| .cy_sharedmem | 0x08001958 | 12 |
| .noinit | 0x08001968 | 148 |
| .bss | 0x08001a00 | 93956 |
| .heap | 0x08018908 | 188024 |
----------------------------------------------------

Thanks,

Best Regards

0 Likes
1 Solution
LeoMathews
Moderator
Moderator
Moderator
First question asked 500 replies posted 100 solutions authored

Hi @xiaotuzi_bengda 

As Startup code is an important part of the compilation and boot-up and it makes sure binary code is organized and the system can run. Therefore any change in the Startup code is also reflected at the end .hex file. The changing of a specific region of the hex may solely depend on the change made to the Startup code.

Thanks and Regards,
Leo

View solution in original post

0 Likes
6 Replies
LeoMathews
Moderator
Moderator
Moderator
First question asked 500 replies posted 100 solutions authored

Hi @xiaotuzi_bengda 

Can you please provide us with the entire console build message? Can you also please check whether there is no other edits done in the startup file?

Thanks and Regards,
Leo

0 Likes

Hello,

Sorry,  i changed my question.

When i deleted ".section .debug_version" in  "startup_psoc6_01_cm4.S" file,

why  "Cy_Flash_ResumeIrqHandler" and "cy_ramfunc" changed?

The ".readelf" file is as follows:無題.png

Thanks,

Best Regards,

 

0 Likes
LeoMathews
Moderator
Moderator
Moderator
First question asked 500 replies posted 100 solutions authored

Hi @xiaotuzi_bengda 

Can you please provide me with some more details regarding the issue? I am not getting a clear idea of the same.

Thanks and Regards,
Leo

0 Likes
lock attach
Attachments are accessible only for community members.

Hi Leo,

Thank you for your replying.

I had made a sample project by ModusToolBox 3.0 to try this.

Please refer to "test.zip".

After I added section define(line73~line81) in"\test\Hello_World\libs\TARGET_CY8CKIT-062-WIFI-BT\COMPONENT_CM4\TOOLCHAIN_GCC_ARM\startup_psoc6_01_cm4.S",  the generated hex file "mtb-example-hal-hello-world.hex" is changed after line3298.

--------------------------------------------------------------------------

/*Creat Ver section*/
.section .version
.align 2
.globl __version
.equ version_Size, 0x0000000c
__version:
.space version_Size
.size __version, . - __version
/*Creat Ver section end*/

-----------------------------------------------------------------------------

Could you please tell me the reason that why "mtb-example-hal-hello-world.hex"is changed after line3298?

Thank you very much!

Best Regards,

0 Likes
LeoMathews
Moderator
Moderator
Moderator
First question asked 500 replies posted 100 solutions authored

Hi @xiaotuzi_bengda 

As Startup code is an important part of the compilation and boot-up and it makes sure binary code is organized and the system can run. Therefore any change in the Startup code is also reflected at the end .hex file. The changing of a specific region of the hex may solely depend on the change made to the Startup code.

Thanks and Regards,
Leo

0 Likes
LeoMathews
Moderator
Moderator
Moderator
First question asked 500 replies posted 100 solutions authored

Hi @xiaotuzi_bengda ,

Thread was locked due to inactivity for long time, you can continue the discussion on the topic by opening a new thread with reference to the locked one. The continuous discussion in an inactive thread may mostly be unattended by community users.

Thanks and Regards,
Leo

0 Likes