nRF53 XIP Bus Fault

I'm attempting to evaluate XIP (NCS 3.0.0) on the nRF53 with a mx25u256 flash chip.
I'm placing a simple test function in external flash:

#define XIP_TEST_INC (100)
int xip_test_function(const int input)
{
        return (input + XIP_TEST_INC);
}


The project builds successfully and I can see the data is flashed at the expected location in the flash chip.

nrfjprog --config ./cam_app/nrfjprog_camelot_qspi.toml -f NRF53 --memrd 0x10120000 --n 2000

0x10120000: 96F3B83D 00000000 00000200 00000004   |=...............|
0x10120010: 00000000 00000B00 00000000 00000000   |................|
0x10120020: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x10120030: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x10120040: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x10120050: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x10120060: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x10120070: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x10120080: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x10120090: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x101200A0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x101200B0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x101200C0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x101200D0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x101200E0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x101200F0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x10120100: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x10120110: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x10120120: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x10120130: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x10120140: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x10120150: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x10120160: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x10120170: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x10120180: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x10120190: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x101201A0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x101201B0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x101201C0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x101201D0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x101201E0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x101201F0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x10120200: 47703064 01506907 00200010 3682920F   |d0pG.iP... ....6|
0x10120210: E7674EFC BAAD3700 C9FBA940 CC0150D7   |[email protected]..|
0x10120220: B91F524B 690FCC17 C2C3D6A6 00200001   |KR.....i...... .|
0x10120230: DC0157FC 32E13561 C4BD4738 E5D2040F   |.W..a5.28G......|
0x10120240: 3B83E5BE 939FC223 01003D59 9499FA8C   |...;#...Y=......|
0x10120250: 01000020 113F1B8A FDA85FC9 D5FF1478   | .....?.._..x...|
0x10120260: BB4212ED 9361DA98 85C9E7EE 7946A416   |..B...a.......Fy|
0x10120270: 55987789 8BEA41A6 2473EE88 9AED911C   |.w.U.A....s$....|
0x10120280: 88546E70 DCF1D938 F1518171 29E09A27   |pnT.8...q.Q.'..)|
0x10120290: 29BA2229 20FC5EA1 DAFA6ACB 74516855   |)".).^. .j..UhQt|
0x101202A0: 637E64BE 1B617729 FD841CAD 5458A7C1   |.d~c)wa.......XT|
0x101202B0: C4C5FE65 AE53F495 9544123D A4A428DD   |e.....S.=.D..(..|
0x101202C0: 37FD55E9 E2F336A2 E3BB84D3 CA373DCC   |.U.7.6.......=7.|
0x101202D0: F176F20D 6085716C EA2F786F AAA460B7   |..v.lq.`ox/..`..|
0x101202E0: C753CA5D DD0A79E4 8B3EE8ED 1AC622E6   |].S..y....>.."..|
0x101202F0: 789CC8EC C5FF355B 5CE0E584 C6B61C12   |...x[5.....\....|
0x10120300: 69A0B574 2643414E FF3951E8 28169802   |t..iNAC&.Q9....(|
0x10120310: 12A1C1F4 816AEA66 EB4F0D67 32673F2D   |....f.j.g.O.-?g2|
0x10120320: FCC7B820 0407C411 65F57740 8FDE309E   | [email protected]..|
0x10120330: FDC10876 8DD54F02 9D731FBC 335E80D9   |v....O....s...^3|
0x10120340: A47B6E2E 7ED1F2F0 ACE61291 14E568C4   |.n{....~.....h..|
0x10120350: 27F89959 FFFFFFFF FFFFFFFF FFFFFFFF   |Y..'............|
0x10120360: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|


The chip is connected to QSPI as follows:

psels = <NRF_PSEL(QSPI_SCK017)>,       
<NRF_PSEL(QSPI_IO0013)>,
<NRF_PSEL(QSPI_IO1014)>,
<NRF_PSEL(QSPI_IO2015)>,
<NRF_PSEL(QSPI_IO3016)>,
<NRF_PSEL(QSPI_CSN018)>;

When the code runs and the XIP function is executed, I receive a bus fault.
 

It appears that it is attempting to execute the code in external flash, based on the address.

And here is an excerpt from the .map file:

0x0000000010120200 . = ALIGN (0x4)
*xip_test.c.obj(SORT_BY_ALIGNMENT(.text.xip_test_function))
.text.xip_test_function
0x0000000010120200 0x4 app/libapp.a(xip_test.c.obj)
0x0000000010120200 xip_test_function
0x0000000010120204 . = ALIGN (0x4)
0x0000000010120204 __extflash_text_reloc_end = .
0x0000000010120200 __extflash_text_reloc_start = ADDR (.extflash_text_reloc)
0x0000000000000004 __extflash_text_reloc_size = (__extflash_text_reloc_end - __extflash_text_reloc_start)
0x0000000010120200 __extflash_text_rom_start = LOADADDR (.extflash_text_reloc)
0x0000000020002000 _ram_mpu_ro_region_start = ORIGIN (RAM)
0x0000000010120204 _ram_mpu_ro_region_end = .

text 0x0000000000010358 0x37d48
0x0000000000010358 __text_region_start = .


I was using the extxip_smp_svr sample as a guide.
Perhaps I have missed something in the configuration?
Any suggestions?

Parents
  • Hello,

    The nrfjprog readout indicates that the Jlink debugger is able to correctly write and read from the external flash at least, but it's not clear if the FW running on the nRF53 is able to do the same. Have you been able to interface with this flash IC with other samples? 

    To troubleshoot further you could try to go to this address in the dissambler to see if the CPU is fetching valid instructions from the xip region or not.

    Best regards,

    Vidar

Reply
  • Hello,

    The nrfjprog readout indicates that the Jlink debugger is able to correctly write and read from the external flash at least, but it's not clear if the FW running on the nRF53 is able to do the same. Have you been able to interface with this flash IC with other samples? 

    To troubleshoot further you could try to go to this address in the dissambler to see if the CPU is fetching valid instructions from the xip region or not.

    Best regards,

    Vidar

Children
Related