Booting from external SPI master issue

6 posts / 0 new
Last post
Ashwin饶
Offline
Last seen:5 years 7 months ago
加入:2015-01-09 05:21
Booting from external SPI master issue

Hi,

I am able to load code @startup using UART but unable to load the same from external SPI master.

I am using CPOL = 0 , CPHA = 0 and a clock of 330 kHz. The CS line is held logic low the whole time without any toggling.

I am using 0 as mode byte ( Byte nr = 6)
I get the Preamble ACK and Length ACK (0x2) at Byte nr. 3 and 6 as expected. But I get a value 0x7F at Byte nr. 8 .

Basically, when I send
spi_TX_buf[10] = {0x70, 0x50, 0, (BLE_CODE_SIZE >> 2) & 0xFF, (BLE_CODE_SIZE >> 10) & 0xFF, BLE_CODE_CRC, 0, 0, 0, 0 }; //Make the first two byte of code as 0 for debug
I get back
spi_RX_buf[] =
[0] (0x00)
[1] (0xDC)
[2] (0 xd4)
[3] (0x02)
[4] (0xE5)
[5] (0xC4)
[6] (0x02)
[7] (0xC0)
[8] (0x7F) //This should have been 0x02 or 0x20
[9] (0xFF)

what could be wrong?

Regards,
Ashwin

Device:
Ashwin饶
Offline
Last seen:5 years 7 months ago
加入:2015-01-09 05:21
Hi,

Hi,

Is booting from SPI master procedure given in AN-B-001 correct? It does not seem to be working for me.

Regards,
Ashwin

JE_Dialog
Offline
Last seen:5 hours 7 min ago
工作人员
加入:2013-12-05 14:02
HI Ashiwn, i am not aware of

HI Ashiwn, i am not aware of any mistakes with this apps note : can i ask what host you are booting from ? BR JE_Dialog

Ashwin饶
Offline
Last seen:5 years 7 months ago
加入:2015-01-09 05:21
Hi,

Hi,
Thanks for the reply. I am using STM32F4 series MCU.
I can see that the MCU is sending out correct data using a scope. And I do get the first two acknowledgements. I am not sure why I don't get the final ACK/NACK.

Regards,
Ashwin

vantassel
Offline
Last seen:1 year 3 months ago
加入:2015-05-26 22:15
I read your post because I'm

I read your post because I'm not getting any Ack or Nack.
Anyway shouldn't this code:
(BLE_CODE_SIZE >> 2) & 0xFF, (BLE_CODE_SIZE >> 10) & 0xFF
be:
BLE_CODE_SIZE & 0xFF, BLE_CODE_SIZE >> 8

Regards, Bob

Ashwin饶
Offline
Last seen:5 years 7 months ago
加入:2015-01-09 05:21
Hi vantassel,

Hi vantassel,

It should be (BLE_CODE_SIZE >> 2) & 0xFF, (BLE_CODE_SIZE >> 10) & 0xFF since the size should be specified in multiple of four bytes when booting from external SPI master.

Regarding the ACK/NACK issue, I think this is a mistake in AN-B-001.
If I Ignore byte nr 8 and proceed as usual, I can download the code and get the last ACK.
But I have not received a confirmation from dialog semi that is the case.

Regards,
Ashwin