spi slave bootloader with xtimecomposer version 14.3

Technical questions regarding the XTC tools and programming with XMOS.
Post Reply
shdrmr
Junior Member
Posts: 6
Joined: Tue Oct 17, 2017 4:47 pm

spi slave bootloader with xtimecomposer version 14.3

Post by shdrmr »

Hey guys,

This is a follow up to the topic I raised (https://xcore.com/viewtopic.php?f=26&t=6124). Long story short my objective was to get the Slicekit x200 to boot from SPI slave. I followed the application note AN00238 but failed many times. Finally I realized that the mapping was done improperly since it requires version 14.2 and I was using 14.3. It works absolutely fine for 14.2.1. In the file "loader_pre_crt.S" from the application note, there is a comment which says:

"tools 14.3 introduced the .crt section, which comes before .text in default ordering; our loader then needs to be in .crt as well otherwise it would be placed after CRT code (even with --first). "

It requires the pre_crt section to be executed before the crt section. As expected, the objdump from the output of compiler version 14.3 does not achieve this and the pre_crt section is not at the initial address 0x40000. The 14.3 version xmap does not place the pre_crt object file first. I have attached the objdump of the 14.2 and 14.3. Do take a loot at how the loadable 2 for tile 0 is different. My questions are:

1 Assuming I use the same bootloader of the application note, How do I ensure that the pre_crt section is placed first followed by the crt section in compiler version 14.3? Do i even need pre crt section or can I ignore any files since the 14.3 section does it automatically.

2. Can i make any changes to the loader in the application note so that it s compaitble with 14.3 version?

3. If I have to write my own bootloader, what is the procedure? I mean what are the general rules to startup an XMOS processor (waht has to be initialized etc). I was thinking that I can use the flags -nodefaultlibs and write my own start section with all of this so that the processor boots accordingly.

Thank you for any advise. This forum is seriously unconditionally helpful :)
Attachments
version_14_3_objdump.txt
14.3 version output
(120.03 KiB) Downloaded 223 times
version_14_3_objdump.txt
14.3 version output
(120.03 KiB) Downloaded 223 times
version_14_2_objdump.txt
14.2 version output
(124.12 KiB) Downloaded 218 times
version_14_2_objdump.txt
14.2 version output
(124.12 KiB) Downloaded 218 times


robertxmos
XCore Addict
Posts: 169
Joined: Fri Oct 23, 2015 10:23 am

Post by robertxmos »

hi shdrmr,

You are right to pick up the app note as needing to be updated - indeed loader_pre_crt.S will fail to compile with 14.3 tools viz "Only for xTIMEcomposer 14.2 or older".

the code in loader_pre_crt.S should be changed to be placed in the foremost section - as well as being 'first' in that section viz:
#if XCC_VERSION_MAJOR > 1402
.section .crt, "ax", @progbits
#else
.section .text, "ax", @progbits
#endif

N.B. '--first' will NOT move things into different section but it will make sure items are placed at the front of their chossen section.
There are numerous code and data sections to choose from, the fist in memory is .crt, followed by .init, .fini, .text, ....

I hope this fixes your issues.
robert
Post Reply