This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2538: SPI Flash conneciton

Part Number: CC2538
Other Parts Discussed in Thread: CC2530

Tool/software:

Hi Team,

I am planning to connect CC2538 with IS25LP128-JBLE Flash. I want to use it as a programming flash. 
I have made the connections as follows:


PA2: CLK

PA3: CS#

PA4: DI

PA5: DO

Can you please confirm if the connections on these lines are fine or there's a particular port to connect the flash to?

Thanks and Kind Regards.

  • Hello Saira,

    Those pins can be used for the ROM serial bootloader. If you don't need that functionality then it's ok to use them for your memory device. SPI signals can be routed to any of the GPIO pins so you could choose any other set of IO if it's more convienent or your require SPI communication with the bootloader. Please see Chapter 9 from the technical reference manual (https://www.ti.com/lit/ug/swru319c/swru319c.pdf)  for information on configuring the internal mux to route signals from the peripherals to the IO.

    Best Regards,

    Jake

  • Hi Jake,
    Thank you for the prompt response.
    I had some doubts regarding the bootloader.

    I need to keep my program in the external SPI flash. Upon power ON i want the microcontroller to fetch the program from the SPI Flash. 

    I had the following questions:

    1.Do i need to program my Bootloader to look for SPI flash for the loading the program into the device flash? 
    2. If the bootloader is not programmed via SSI/UART0 and there is no image in the internal Flash, where is the default peripheral where the ROM bootloader look for?
    3. Can I establish communication with the Bootloader through SPI? (The document on ROM Bootloader for CC2538 mentions SSI and UART0)

    Thanks and Kind Regards.

  • Hi Saira,

    1) The ROM based serial bootloader supports functions for erasing and writing flash. If you need to load data from flash on boot you would need develop your own custom bootloader. See https://www.ti.com/lit/an/swra466e/swra466e.pdf for the supported boot loader functionality.

    2) See 2.3.3 from https://www.ti.com/lit/ug/swru333a/swru333a.pdf: 
    "The boot loader selects the first interface accessed by the external device. Once selected, the
    module clock for the inactive interface (UART0 or SSI0) is disabled. To switch over to the other
    interface, the CC2538 must be reset

    3) yes, the SSI interface supports SPI and similar serial protocols.

    BR,

    Jake

  • Hi Saira,

    As the ROM bootloader will not interface with an external SPI flash memory device, you will need two CC2538 projects:

    • An Image Boot Manager application which begins as device startup, reads its own internal flash memory and the external SPI flash memory, determines which area contains a valid and updated functional application, and either copies the external flash or maintains the internal flash before jumping to the main application.
    • The main application is stored on the device and alternatively on the external flash, with a known header location which contains values for update versions, types, etc.

    An example of this is provided with the Z-Stack 3.0.2 for OTA purposes.  However, the CC2538 example supports on-chip OTA (aka dual-image) whereas only the CC2530 supports off-chip OTA (using external flash memory) for the out-of-box demonstration.  Thus further changes and development will be required to realize your use case.

    Regards,
    Ryan

  • Hi and ,

    Thank you so much for the prompt response. I appreciate your patience.

    Alternatively, is this application implementation possible?

    Use CC2538 Device Bootloader at RESET/Power On and point at the Application program in the SPI Flash instead of the Application partition from the Device Flash.
    I have made the Hardware connections as follows:

    1. Is it possible that the Device Flash Bootloader code points to the External SPI Flash Address instead of the Device Flash Application partition? 
    2. What are the hardware implementations and considerations for the above application? 
    3. What are the software implementations and considerations for the above application? 

    Thanks and Kind Regards.

  • It is not possible to operate the CC2538 using application code stored on an external SPI flash device.  The application code must be copied to internal device flash.

    Otherwise, your design is feasible given custom flash bootloader development using TI resources mentioned earlier  as a reference.

    Regards,
    Ryan

  • Thank you, Ryan, for the clarification.

    Additionally, I had a few more questions,

    1. When custom Flash Bootloader is developed, If I am Using UART0 to load the bootloader, at that point SSI0 port will be disabled? 
    2. Once the custom bootloader is flashed in CC2538, SSI0 can be used for SPI Flash and UART0 port can be used as a peripheral?
    3. The bootloader will reside on the Device Flash itself or in the external Flash? 
    4. Are the Hardware Connections feasible for me to use the Bootloader Customization as well as use these lines for SPI and UART Protocol?



    Appreciate your patience. 

    Thanks and Kind Regards.

  • 1. Since you are developing the custom flash Bootloader you can decide whether the SSI0 port is enabled or disabled.
    2. Same as above
    3. Device flash
    4. I'm not aware of an immediate issue with the hardware connections.

    May I ask why you are evaluating the legacy CC2538 instead of a newer SimpleLink F2 (CC13X2 / CC26X2) device?

    Regards,
    Ryan