Hello Team,
We are interfacing nRF52832 with an external flash for data storage. Could you please point to the right document/link/code reference on how to interface external flash (on SPI) with nRF52832 on nRF Connect SDK 1.8.0?
Thanks!
Hello Team,
We are interfacing nRF52832 with an external flash for data storage. Could you please point to the right document/link/code reference on how to interface external flash (on SPI) with nRF52832 on nRF Connect SDK 1.8.0?
Thanks!
Hi Hakon,
I tried what you suggested and here is the outcome:
Reading symbols from c:\Users\ncs\v1.8.0\toolchain\opt\bin\arm-none-eabi-objdump.exe --syms -C -h -w c:\Users\Documents\Work\build\zephyr\zephyr.hex
Reading symbols from c:/users\ncs\v1.8.0\toolchain\opt\bin\arm-none-eabi-nm.exe --defined-only -S -l -C -p c:\Users\Documents\Work\build\zephyr\zephyr.hex
Launching GDB: "c:\\Users\\ncs\\v1.8.0\\toolchain\\opt\\bin\\arm-none-eabi-gdb.exe" -q --interpreter=mi2 "c:\\Users\\Documents\\\Work\\build\\zephyr\\zephyr.hex"
Set "showDevDebugOutput": true in your "launch.json" to see verbose GDB transactions here. Helpful to debug issues or report problems
Launching gdb-server: "C:\\Program Files\\SEGGER\\JLink\\JLinkGDBServerCL.exe" -singlerun -nogui -if swd -port 50007 -swoport 50008 -telnetport 50009 -device nRF52832_xxAA -select usb=601005338 -rtos "C:\\Program Files\\SEGGER\\JLink\\GDBServer\\RTOSPlugin_Zephyr.dll"
Please check TERMINAL tab (gdb-server) for output from C:\Program Files\SEGGER\JLink\JLinkGDBServerCL.exe
Finished reading symbols from nm: Time: 186 ms
Finished reading symbols from objdump: Time: 234 ms
Reading symbols from c:\Users\Documents\Work\build\zephyr\zephyr.hex...
(No debugging symbols found in c:\Users\Documents\Work\build\zephyr\zephyr.hex)
WARNING: Cortex-Debug will deprecate use of GDB version 8 after July 2022. Please upgrade to version 9+
0x0001999e in ?? ()
Program stopped, probably due to a reset and/or halt issued by debugger
add symbol table from file "c:/Users/Documents/Work/build/zephyr/zephyr.elf"
(y or n) [answered Y; input not from terminal]
Reading symbols from c:/Users/Documents/Work/build/zephyr/zephyr.elf...
Resetting target
Resetting target
[New Thread 536881256]
[New Thread 536881008]
[New Thread 536880760]
[New Thread 536881504]
[Switching to Thread 536881256]
Thread 2 hit Temporary breakpoint 1, main () at ../src/main.c:24
24 {
[New Thread 536878976]
[New Thread 536878728]
[New Thread 536878480]
[New Thread 536880512]
Thread
3 received signal SIGTRAP, Trace/breakpoint trap.
[Switching to Thread 536881008]
?? () at C:/Users/ncs/v1.8.0/zephyr/arch/arm/core/aarch32\cpu_idle.S:107
107 cpsie i
Resetting target
[Switching to Thread 536881256]
Thread 2 hit Temporary breakpoint 2, main () at ../src/main.c:24
24 {So, it seems it doesn't work when we Flash the board for the first time and also when we connect power to the board for the first time. After that it works always.
Thanks!
Hi Hakon,
I tried what you suggested and here is the outcome:
Reading symbols from c:\Users\ncs\v1.8.0\toolchain\opt\bin\arm-none-eabi-objdump.exe --syms -C -h -w c:\Users\Documents\Work\build\zephyr\zephyr.hex
Reading symbols from c:/users\ncs\v1.8.0\toolchain\opt\bin\arm-none-eabi-nm.exe --defined-only -S -l -C -p c:\Users\Documents\Work\build\zephyr\zephyr.hex
Launching GDB: "c:\\Users\\ncs\\v1.8.0\\toolchain\\opt\\bin\\arm-none-eabi-gdb.exe" -q --interpreter=mi2 "c:\\Users\\Documents\\\Work\\build\\zephyr\\zephyr.hex"
Set "showDevDebugOutput": true in your "launch.json" to see verbose GDB transactions here. Helpful to debug issues or report problems
Launching gdb-server: "C:\\Program Files\\SEGGER\\JLink\\JLinkGDBServerCL.exe" -singlerun -nogui -if swd -port 50007 -swoport 50008 -telnetport 50009 -device nRF52832_xxAA -select usb=601005338 -rtos "C:\\Program Files\\SEGGER\\JLink\\GDBServer\\RTOSPlugin_Zephyr.dll"
Please check TERMINAL tab (gdb-server) for output from C:\Program Files\SEGGER\JLink\JLinkGDBServerCL.exe
Finished reading symbols from nm: Time: 186 ms
Finished reading symbols from objdump: Time: 234 ms
Reading symbols from c:\Users\Documents\Work\build\zephyr\zephyr.hex...
(No debugging symbols found in c:\Users\Documents\Work\build\zephyr\zephyr.hex)
WARNING: Cortex-Debug will deprecate use of GDB version 8 after July 2022. Please upgrade to version 9+
0x0001999e in ?? ()
Program stopped, probably due to a reset and/or halt issued by debugger
add symbol table from file "c:/Users/Documents/Work/build/zephyr/zephyr.elf"
(y or n) [answered Y; input not from terminal]
Reading symbols from c:/Users/Documents/Work/build/zephyr/zephyr.elf...
Resetting target
Resetting target
[New Thread 536881256]
[New Thread 536881008]
[New Thread 536880760]
[New Thread 536881504]
[Switching to Thread 536881256]
Thread 2 hit Temporary breakpoint 1, main () at ../src/main.c:24
24 {
[New Thread 536878976]
[New Thread 536878728]
[New Thread 536878480]
[New Thread 536880512]
Thread
3 received signal SIGTRAP, Trace/breakpoint trap.
[Switching to Thread 536881008]
?? () at C:/Users/ncs/v1.8.0/zephyr/arch/arm/core/aarch32\cpu_idle.S:107
107 cpsie i
Resetting target
[Switching to Thread 536881256]
Thread 2 hit Temporary breakpoint 2, main () at ../src/main.c:24
24 {So, it seems it doesn't work when we Flash the board for the first time and also when we connect power to the board for the first time. After that it works always.
Thanks!
Hi,
harshal034 said:and also when we connect power to the board for the first time
This is interesting. It does sound like a timing issue.
Could you scope the SPI lines, VDD_NRF and VDD_SPI, to see if the "time delay before write instruction" (tPUW in the flash datasheet) of 5 ms is honored on the very first run?
If you are unsure on how to test the above, or do not have such equipment available, you could (only for testing purposes!!) try to add a k_sleep delay before this sequence:
https://github.com/nrfconnect/sdk-zephyr/blob/v2.7.0-ncs1/drivers/flash/spi_nor.c#L1037-L1055
Kind regards,
Håkon