Tool/software: Code Composer Studio
Hi all,
I did 2 projects with cc2640r2f using external flash (AT45DB041E adesto) to implement OAD.
in the first project the OAD working fantastic, and I can download an image save it to the external flash and check the CRC, and read it i the bootloader after the reset.
in the second project, I can download the image and check the CRC correctly, but after the reset the bootloader failed to read the image from the flash.
I tried to connect a scope to understand what is the problem then every thing gone OK. and the bootloader manage to read the image.
I disconnect scope the problem return again, then after some research I found that I need to connect a resistor between the MOSI and the ground in order to activate the SPI in the bootloader.
the bootloader (BIM) is same in the two projects and the HW schematics are same. but only one project need the resistor between the MOSI and the ground, I can't know what is the difference!
in the application code with implement the OAD I can access the external flash and read the image from it without any resistor, but in the bootloader I do need the resistor.
the bootloader SPI driver is "bsp_spi.c" , attached code sample.
SSIIntDisable(BLS_SPI_BASE, SSI_RXOR | SSI_RXFF | SSI_RXTO | SSI_TXFF);
SSIIntClear(BLS_SPI_BASE, SSI_RXOR | SSI_RXTO);
SSIConfigSetExpClk(BLS_SPI_BASE,
BLS_CPU_FREQ, /* CPU rate */
SSI_FRF_MOTO_MODE_0, /* frame format */
SSI_MODE_MASTER, /* mode */
bitRate, /* bit rate */
8); /* data size */
IOCPinTypeSsiMaster(BLS_SPI_BASE, BSP_SPI_MISO, BSP_SPI_MOSI,
IOID_UNUSED /* csn */, clkPin);
SSIEnable(BLS_SPI_BASE);
and the application SPI driver is "SPICC26XXDMA.c", attached sample code
SPI_Params spiParams;
SPI_Params_init(&spiParams);
spiParams.bitRate = defaultParams.spiBitRate;
spiParams.frameFormat = defaultParams.spiFrameFormat;
/* Try open the SPI */
spiHandle = SPI_open(flashHwAttrs->spiIndex, &spiParams);
Does any one have some advices?
Best regards,
Amir