The error log is as follows, of course I added some print.
Error message ...Info : Valid NUSPI on device Nuclei SoC SPI Flash at address 0xfa0000000 with spictrl regbase at 0xf8b120000 Info : Nuclei SPI controller version 0x00010207 Info : Found flash device 'win w25q128fv/jv' (ID 0x001840ef) Info : Listening on port 6666 for tcl connections Info : Listening on port 4444 for telnet connections Info : accepting 'gdb' connection on tcp/3333 Error: xxxx sizeof:4 Error: xxxx packet:vFlashErase:0000000fa0000000,00010000 Error: xxxx addr:ffffffff Error: No flash at address 0xffffffff Error: flash_erase returned -4 I made the changes and it works fine with flash, I'm not sure if a similar problem exists within openocd. The unsigned long type on windows is defined as 4 bytes https://learn.microsoft.com/en-us/cpp/cpp/data-type-ranges?view=msvc-170
0001-server-gdb-server-fix-flash-operation-error-when-add.patch
Description: Binary data