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.

RTOS/LAUNCHXL-CC2650: Example to read/write to 1MB spi flash memory on launchpad

Part Number: LAUNCHXL-CC2650
Other Parts Discussed in Thread: CC2650, BLE-STACK

Tool/software: TI-RTOS

Can someone point me to example code to read and write to the 1MB serial flash that is provided on the launchpad board?

Thanks.

Dale

  • Hi,

    You can see the FlashOnly_OAD_ExtFlash configuration of the simple_peripheral project as an example that writes to flash. The functions that are used to read from and write to flash are in ExtFlash.c.

    -Nathan
  • Hi Nathan,

    So far I have only used Resource Explorer in ccs7 to load example projects.
    I do not see one labelled simple_peripheral in the CC2650 Launchpad examples.
    I'm a real newbie and I don't know where to find and load the simple_peripheral project if it is not in my ccs7 Resource Explorer.
    Is there a link and instructions somewhere (my basic google search didn't help me)

    Thanks,
    Dale
  • Hi,

    To get that and other projects, you need to install the BLE-stack 2.2.1. You can find it here: www.ti.com/.../BLE-STACK.
    It includes a Bluetooth low energy Software Developer's Guide that provides documentation on using it and running the example applications.

    -Nathan
  • Nathan,

     Although I have sample code now, I am unable to integrate it into LAUNCHXL-CC2650 ProjectZero code.

     I copied the ExtFlash.c and ExtFlash.h into my ProjectZero Applications directory,

     When I build, the error I get points me to the fact that simple_peripheral and ProjectZero have different SPICC26XXDMA.h files.

     I am surprised that the prominently advertised feature of the LAUNCHXL-CC2650 ("Includes 1 MB external Flash for support of multiple protocols or storing user data") requires such a low level of programming knowledge to use it.

     Am I really taking the easiest route to being able to read and write user data to the boards external Flash?

     If so, what do I do next? Should I start another topic?

     Thanks,

    Dale

  • Hi,

    It is likely that the version of project zero that you are using in the resource explorer is using a different version of the sdk from the one you are taking the files from. If you click on the tab labeled SimpleLink academy in the Resource Explorer Classic, you will be able to find what version of the sdk your project is using.

    -Nathan
  • I can't find a tab for SimpleLink academy in my Resource Explorer Classic, what do I do when I find out what version of the sdk ProjectZero uses?

    Dale
  • Hi,

    On the left side of the Resource Explorer you should see directories. The SimpleLink Academy one should be the one that you found Project Zero in. Clicking on the SimpleLink Academy tab (instead of going inside the directory) should help you find the version. You will need to make sure you have that version of the sdk installed.

    -Nathan
  • I had to download and install Simplelink Academy and then it appeared on the left.

    I navigated to ProjectZero in the BLE examples and imported the project into CCS.

    Wow, it doesn't look at all like the ProjectZero I imported to my IDE from the standard Resource Explorer. This version has the Middleware directory with ExtFlash.h and a greyed out ExtFlash.c (why is it greyed out?).

    It also looks like it uses the correct SPICC26XXDMA.h, plus lots more different...

    I will try to get external flash routines working in this project.

    Thanks,
    Dale

  • Well, not much luck in figuring what to do to be able to use the routines in ExtFlash.c using the ProjectZero for the LAUNCHXL-CC2650 from the SimpleLink Academy as a start point.

    So far I have tried un-checking 'Exclude from build' on these files:

    middleware/extflash/extflash.c

    drivers/spi/ SPICC26XXDMA.c

    drivers/spi/spi.c

    Then I include ExtFlash.c in project_zero.c with:

    #include <ti/mw/extflash/ExtFlash.h> //dale

    Then I try to use a function of ExtFlash.c at the end of project_zero.c's ProjectZero_init(void) as follows:

        bool success = ExtFlash_open();  //dale
        if (success){
            Log_info0("Ext Flash Opened, Yeah!!");
        }

    This just results in build memory errors like this:

    "c:/ti/simplelink/ble_sdk_2_02_01_18/src/common/cc26xx/ccs/cc26xx_app.cmd", line 121: error #10099-D: program will not fit into available memory.  placement with alignment fails for section ".const" size 0x1ef7 .  Available memory ranges:
       FLASH        size: 0xe000       unused: 0x467        max hole: 0x45c     
       FLASH_LAST_PAGE   size: 0x1000       unused: 0xfa8        max hole: 0xfa8     
    error #10010: errors encountered during linking; "project_zero_app_cc2650launchxl.out" not built

    >> Compilation failure
    makefile:190: recipe for target 'project_zero_app_cc2650launchxl.out' failed
    makefile:183: recipe for target 'all' failed
    gmake[1]: *** [project_zero_app_cc2650launchxl.out] Error 1
    gmake: *** [all] Error 2

    EDIT: Solved that memory error by disabling all logging and by not starting the uart (so much for that useful tool!!!).

    Now, when I try to use ExtFlash_open() as noted above, the program just gets stalled on that line and stays in some assembly code section.

    I think I am really lost now.

    It just shouldn't be so hard to use the advertised external data storage flash :(

    Dale

  • Nathan,

    Sorry, but I have yet to figure out how to get the 'FlashOnly_OAD_ExtFlash' configuration of the simple_peripheral project.

    I am stumped by FlashOnly_OAD_ExtFlash.

    Dale
  • Nathan,

    Thanks for the help but this is still a long ways away from me actually being able to read and write to the external flash.

    JXS has helped me in another thread, if anyone want to see this through:

  • Hi,

    Based on the other thread, it seems that you solved the issue. Are you still encountering any issues?

    -Nathan
  • Yes, I am having trouble figuring out how to write single bytes to a flash location without having to erase 4k of flash at that location first. I have posted details in the other thread.
    Thanks,
    Dale