XU316 - Unable to boot from SPI, any hints?

Technical discussions around xCORE processors (e.g. xcore-200 & xcore.ai).
AnkhInnovationsLLC
New User
Posts: 2
Joined: Mon Dec 25, 2023 12:19 am

XU316 - Unable to boot from SPI, any hints?

Post by AnkhInnovationsLLC »

Hello,

I'm trying to boot the XK-Voice-SQ66 from another MCU, by providing the firmware image over SPI. This helps keep our part cost and board complexity down, but haven't been having much luck with it.

Board Setup
1. Solder 1 wire to PIN 10 of J1 for the RST_N
2. Solder 1 wire to PIN to BOOT_SEL of J6
3. Connected pins: CS, CLK, MOSI, RST_N, BOOT_SEL

Firmware Compilation
export PATH="$PATH:/Applications/XMOS_XTC_15.2.1/bin"
source "/Applications/XMOS_XTC_15.2.1/SetEnv.sh"
cd /Users/kevin/Downloads/XVF3800-Software_v3_0_0/sources
pip3 install -r requirements_build.txt
cmake --preset=rel_app_xvf3800
cmake --build --preset=ua-io48-sqr

Generate the SPI BIN
python3 /Users/kevin/Downloads/XVF3800-Software_v3_0_0/sources/modules/fwk_xvf/modules/boot_spi_slave/scripts/generate_image.py build/application_xvf3800_ua-io48-sqr.xe

At this point the bin file is copied to the MCU for flashing by SPI... SPI is set:
- To a 5 Mhz Clock Rate
- Mode: 0/0
- LSB First (for each byte)
- Half Duplex
- Include a delay of 2ms with every 4092 bytes sent (the sending MCU can only send 4096-4 bytes at a time)

What I've tried:
- Verified the CRC of the BIN from my computer matches what will be sent by the MCU
- Setting various clock rates (0.1, 2, 4, 10 Mhz)
- Check what the signal looks like through PulseView

From my understanding of the data sheets after the image is clocked in, the board is XVF is just supposed to boot.

xxd output of the beginning of the .bin file:
Image

PulseView output of the beginning of SPI communication, showing the LSB data on MOSI
Image

PulseView output of the overall signal. CS is not immediately brought high, because I need to send the data in several transactions...
Image

This leads me to xrun --dumpstate which reveals the following the following 2x debug statements:

Code: Select all

xrun: Program received signal ET_ECALL, Application exception.
      0x000fe504 in ?? ()
      
      ***** Active Cores *****
        2  tile[1] core[0]  0xfff008ec in ?? ()
      * 1  tile[0] core[0]  0x000fe504 in ?? ()
      
      Thread 2 (tile[1] core[0]):
      
      ***** Call Stack *****
      #0  0xfff008ec in ?? ()
      #1  0xfff00406 in ?? ()
      Backtrace stopped: previous frame identical to this frame (corrupt stack?)
      
      ***** Disassembly *****
      0xfff008ec:	in (2r)         r1, res[r6] *
      0xfff008ee:	setd (r2r)      res[r6], r1
      0xfff008f0:	in (2r)         r2, res[r6] *
      0xfff008f2:	ldw (ru6)       r4, dp[0x0]
      0xfff008f4:	mkmsk (rus)     r5, 0x20
      
      ***** Registers *****
      r0             0x0	0
      r1             0x0	0
      r2             0x0	0
      r3             0x80000	524288
      r4             0x200100	2097408
      r5             0x0	0
      r6             0x10002	65538
      r7             0x45	69
      r8             0x0	0
      r9             0x10003	65539
      r10            0x3	3
      r11            0x40b	1035
      cp             0x0	0
      dp             0xfff026c8	-1038648
      sp             0xfff7c	1048444
      lr             0xfff00406	-1047546
      pc             0xfff008ec	-1046292
      sr             0x40	64
      spc            0x0	0
      ssr            0x0	0
      et             0x0	0
      ed             0x0	0
      sed            0x0	0
      kep            0xfff00500	-1047296
      ksp            0xfff008ec	-1046292
      vec_vsr        0x0	0
      vec_c          {v8_int32 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v16_int16 = {0x0 <repeats 16 times>}, v32_int8 = {0x0 <repeats 32 times>}}
      vec_d          {v8_int32 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v16_int16 = {0x0 <repeats 16 times>}, v32_int8 = {0x0 <repeats 32 times>}}
      vec_r          {v8_int32 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v16_int16 = {0x0 <repeats 16 times>}, v32_int8 = {0x0 <repeats 32 times>}}
      
      Thread 1 (tile[0] core[0]):
      
      ***** Call Stack *****
      #0  0x000fe504 in ?? ()
      #1  0x000fedac in ?? ()
      Backtrace stopped: previous frame identical to this frame (corrupt stack?)
      
      ***** Disassembly *****
      0xfe504:	ecallf (1r)     r0
      0xfe506:	nop (0r)        
      0xfe508:	ldaw (ru6)      r7, sp[0x2]
      0xfe50a:	add (2rus)      r0, r8, 0x0
      0xfe50c:	add (2rus)      r1, r7, 0x0
      
      ***** Registers *****
      r0             0x0	0
      r1             0x1	1
      r2             0x22000000	570425344
      r3             0x20	32
      r4             0x0	0
      r5             0x722	1826
      r6             0x7e6136	8282422
      r7             0x0	0
      r8             0x80000	524288
      r9             0x3	3
      r10            0x6	6
      r11            0x2200	8704
      cp             0xffc20	1047584
      dp             0xffcb8	1047736
      sp             0xfff38	1048376
      lr             0xfedac	1043884
      pc             0xfe504	1041668
      sr             0x51	81
      spc            0xfe504	1041668
      ssr            0x100	256
      et             0x18	24
      ed             0x0	0
      sed            0x0	0
      kep            0xfe280	1041024
      ksp            0xfe2ca	1041098
      vec_vsr        0x0	0
      vec_c          {v8_int32 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v16_int16 = {0x0 <repeats 16 times>}, v32_int8 = {0x0 <repeats 32 times>}}
      vec_d          {v8_int32 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v16_int16 = {0x0 <repeats 16 times>}, v32_int8 = {0x0 <repeats 32 times>}}
      vec_r          {v8_int32 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v16_int16 = {0x0 <repeats 16 times>}, v32_int8 = {0x0 <repeats 32 times>}}
vec_r          {v8_int32 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v16_int16 = {0x0 <repeats 16 times>}, v32_int8 = {0x0 <repeats 32 times>}}

Code: Select all


***** Active Cores *****
  2  tile[1] core[0]  0xfff008ec in ?? ()
* 1  tile[0] core[0]  0xfff00b04 in ?? ()

Thread 2 (tile[1] core[0]):

***** Call Stack *****
#0  0xfff008ec in ?? ()
#1  0xfff00406 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

***** Disassembly *****
0xfff008ec:	in (2r)         r1, res[r6] *
0xfff008ee:	setd (r2r)      res[r6], r1
0xfff008f0:	in (2r)         r2, res[r6] *
0xfff008f2:	ldw (ru6)       r4, dp[0x0]
0xfff008f4:	mkmsk (rus)     r5, 0x20

***** Registers *****
r0             0x0	0
r1             0x0	0
r2             0x0	0
r3             0x80000	524288
r4             0x200100	2097408
r5             0x0	0
r6             0x10002	65538
r7             0x45	69
r8             0x0	0
r9             0x10003	65539
r10            0x3	3
r11            0x40b	1035
cp             0x0	0
dp             0xfff026c8	-1038648
sp             0xfff7c	1048444
lr             0xfff00406	-1047546
pc             0xfff008ec	-1046292
sr             0x40	64
spc            0x0	0
ssr            0x0	0
et             0x0	0
ed             0x0	0
sed            0x0	0
kep            0xfff00500	-1047296
ksp            0x0	0
vec_vsr        0x0	0
vec_c          {v8_int32 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v16_int16 = {0x0 <repeats 16 times>}, v32_int8 = {0x0 <repeats 32 times>}}
vec_d          {v8_int32 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v16_int16 = {0x0 <repeats 16 times>}, v32_int8 = {0x0 <repeats 32 times>}}
vec_r          {v8_int32 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v16_int16 = {0x0 <repeats 16 times>}, v32_int8 = {0x0 <repeats 32 times>}}

Thread 1 (tile[0] core[0]):

***** Call Stack *****
#0  0xfff00b04 in ?? ()
#1  0xfff004c8 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

***** Disassembly *****
0xfff00b04:	in (2r)         r11, res[r1] *
0xfff00b06:	ldc (ru6)       r11, 0x0
0xfff00b08:	setd (r2r)      res[r1], r11
0xfff00b0a:	waiteu (0r)      *
0xfff00b0c:	in (2r)         r8, res[r3] *

***** Registers *****
r0             0x10100	65792
r1             0x10200	66048
r2             0x106	262
r3             0x10300	66304
r4             0x80000	524288
r5             0x0	0
r6             0xedb88320	-306674912
r7             0xffffffff	-1
r8             0x0	0
r9             0x3	3
r10            0x7	7
r11            0x1	1
cp             0x0	0
dp             0xfff026c8	-1038648
sp             0xfff7c	1048444
lr             0xfff004c8	-1047352
pc             0xfff00b04	-1045756
sr             0x40	64
spc            0x0	0
ssr            0x0	0
et             0x0	0
ed             0x0	0
sed            0x0	0
kep            0xfff00500	-1047296
ksp            0x0	0
vec_vsr        0x0	0
vec_c          {v8_int32 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v16_int16 = {0x0 <repeats 16 times>}, v32_int8 = {0x0 <repeats 32 times>}}
vec_d          {v8_int32 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v16_int16 = {0x0 <repeats 16 times>}, v32_int8 = {0x0 <repeats 32 times>}}
vec_r          {v8_int32 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v16_int16 = {0x0 <repeats 16 times>}, v32_int8 = {0x0 <repeats 32 times>}}
So I'm unsure if this is corruption of the transferred image, if the target needs to be modified first not to use <Boot><Source Location="SPI:bootFlash"/></Boot>, if the block size must be 4096 bytes or something else that I'm not thinking of... Any help would be appreciated.

Regards,
Kevin


AnkhInnovationsLLC
New User
Posts: 2
Joined: Mon Dec 25, 2023 12:19 am

Post by AnkhInnovationsLLC »

Update: Got it to boot this afternoon with a block size of 4096K, and a transaction for each block.