spi slave bootloader with xtimecomposer version 14.3
Posted: Fri Oct 20, 2017 12:39 pm
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 :)
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 :)