Good Evening.
I'm facing a strange issues that I cannot explain to myself, maybe U can help me on this
I compiled your secondary bootloader project with the support of UART ans SPI (changes in bootloader.h)
-#undef SUPPORT_AN_B_001 //Enable it for the secondary bootloader
+#define SUPPORT_AN_B_001 //Enable it for the secondary bootloader
-#define ALLOW_NO_HEADER
+#undef ALLOW_NO_HEADER
-#define AES_ENCRYPTED_IMAGE_SUPPORTED 1
+#define AES_ENCRYPTED_IMAGE_SUPPORTED 0 //as per UM-B-012 page 15
-#undef UART_SUPPORTED
+#define UART_SUPPORTED
#define SPI_FLASH_SUPPORTED
The UART download works perfect with the jumpers on J6 in uart mode, as per your documentation .
Move the jumper in SPI configuration I'm not able to load the code present on the Flash (the smartsnippet confirm it is present on flash when I read it)
But the strange part is that the flash is correctly read when some other register are used for example :
#define MAN_DEV_ID 0x90
#define READ_UNIQUE_ID 0x4b
but return an header full of 0xFF when it is read from the code:
SpiFlashRead((unsigned long)&AN001Header, (unsigned long) 0, (unsigned long)AN001_SPI_HEADER_SIZE);
Did I do something wrong?
In attach a pdf with the dump of the spi memory and the snapshot of the debug session
Mik
P.s.
in spi_commands.c added the new functions
uint16_t spi_flash_type(void) {
return spi_read_flash_memory_man_and_dev_id();
}
uint64_t spi_UniqueId(void) {
return spi_read_flash_unique_id();
}
Hi fontamiHw,
Are you trying to follow a specific application note or do something in particular ? Can you please describe the steps you are following ? Also try to print the content of the SPI flash using a uart, just to be sure, you can use one of the spi peripheral examples for that.
Thanks MT_dialog
Ok.
I did more tests and still I do not understand what happen.
I started from the example U suggest (thank it was really useful) and discover that, at the first start, I had the same problem I faced with my second boot-loader .
The tests of which flash the evaluation PRO mount , and its unique number work correctly, but read the page return full of 0xff.
Continuing the test I wrote some data, and was able to read the sames (so correctly the flash has been programmed through its SPI channel).
但是如果我读的Flash SmartSnippet……still see the application I downloaded at the beginning of this thread with the "SPI Flash Programmer" tab.
Based on this experience, I slightly changed the secondary boot-loader.
When boot from UART, I copied all the bytes into the SPI Flash and start the downloaded application
When boot from SPI it start the application reading it from the SPI Flash.
I did some tests and copied into the flash,using the uart boot, different applications.
All the time I run the secondary bootloader with the Keil debug correctly they are executed , both UART boot as well as after SPI boot.
But still SmartSnippet shows me the other application into the SPI.
The curios point now is :
The OTP image is the original one, and when I power on the Pro without the debugger the "SmartSippet application" is executed.
Even if I remove all the jumper on J6, at the power On this application is launched (and the secondary bootloader cannot read the Flash without the jumper)
Because i would like to burn into the OTP my changed secondary bootloader, my question is.....
From where the OTP read the "Smartsnippet application" and not the one in Flash ?
If I well understood, the original OTP read sequentially from UART SI and I2C, so why this behavior?
Mik
Hi fontamiHw,
Regarding the Smart Snippets and the SPI, Please make sure that you ve correctly configured the SPI pins on the PRO board (check the jumpers) also make sure that in the board setup tab the appropriate pins are selected for the SPI Flash pin configuration. Also on Smart Snippets try to connect by using the JTAG interface in case you are using the UART interface and please check one more time if the correct image returns. Regarding your questions i am a bit confused and i dont get what you mean exactly, you say that when the SPI flash is loaded with an image, even if you remove the SPI jumpers the image from the spi is loaded ? The primary bootloader boots from the OTP if the applications flags are enabled and that disables the serial booting of the primary bootloader, please check the document UM-B-012_DA14580_581_583 Creation of a secondary boot loader_v3.0 and the AN-B-001 - Booting from serial interfaces v2.0 document for the procedures the 580 goes through in order to boot.
Thanks MT_dialog