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.

MSP432P4011: bootloader c-array - BLE Plugin OAD

Part Number: MSP432P4011

Hi,
we have build an extensive program, running many tasks, which performs ok. We also have oad as part of this software which means we alo have the c-array of the boorloader for booting the local appplication from address 0x00100000 to its final location. This al works well. We assumed that the sample "oad_bootloader_source_MSP_EXP432P4111_nortos_ccs" is the source of this custom bootloader.

We use:

simplelink_sdk_ble_plugin_3_20_00_24
simplelink_msp432p4_sdk_3_40_01_02
srecord-1.64

We transformed this by replacing the 4111 by the 4011 we use! Of course we selected the appropriate startup- and system files, changed the defined device and appplied required modifications like modules and pinning.
We replace 'Reset_Handler(line 177 in startup_msp432p4011_ccs.c' with 'resetISR' because this seems wrong if compared with the same file from the MSP432P4111!

In the end the project builds ok and also produces the required 'oad_bootloader_source_MSP_EXP432P4011_nortos_ccs.txt' file.

We renamed this file to 'oad_bl_4011_input.txt' for convenience.

Next we try to create the c-array using:

srec_cat.exe oad_bl_4011_input.txt -ti_txt -o oad_bootloader.c -ca oad_bootloader -c_comp

We don't know if this is correct but, do know using the result doesn't work!

If we startup the debugger we get:

The original array works fine and, that came from the sdk used at that time(2019), when we started with 'oad_firmware_update_MSP_EXP432P4111_tirtos_ccs'! 

Question 1: is this the wrong/incomplete conversion?

Question 2: What else?

Question 3: How could we debug the source bootloader project?

regards,
Laurent

  • Hello Laurent,

    We  have an MSP432P4111 specific example for the BLE Plugin - OAD (plus source). Can you start from there to see fi that works for you?

    https://dev.ti.com/tirex/explore/node?node=AK0RCCR8sAQe-aPnrANqvg__kmPly-e__LATEST

  • Hi Jace,

    we already know that example since we used it to start our development a few years ago. We already tried at that time to compile the bootloader, create a c-array and use it. At that time we didn't get it to work either. Since its the only thing left to do for this project we are now trying to get it done!

    Second question was ideas or tips on how to debug the boorloader?

    regards,

    Laurent

  • Hi Laurent,

    Can you clarify how the MSP432P4111 example did not work for you? I am able to use the MSP432P4111 oad_firmware_update example to update both the SNP and SAP images. Are you running into any errors? If you use CCS to place breakpoints in your code, can you see where your code is reaching at the time of errors? 

    Best regards,

    Kristen 

  • When we started our project we discovered that if you upload the oaf_firmware_update over and over again, it seems to work ok! But we added a version number as one of the first things! If we then try do upload it the original code doesn't work as it fails on erasing in the function:

    Adding version:
    file: oad_firmware_update.c

    declaration:
    // Software revision
    const char version_cc[] = "001";

    function:
    oad_init()
    // Software Revision CC
    devInfoArray[4][2] = version_cc[0];

    called in top of function:
    oad_taskFxn(void *arg0)

    so it can be read with f.i. BLE Scanner!

    file: oad_target_internal_flash.c

    Here's were the error occurs, also in the original code in our case!

    function: bool OADTarget_writeFlash(...)

    code: NVS_erase(curOADHandle, 0, regionOADAttrs.regionSize);

    So, if you uplad exactly the same file, no error will occur since the same byte is programmed at the same location again producing no error. But in fact the old version was never completely removed, only the first part up to some point!

    So we changed this code for erasing smaller blocks(less time) to:

    if (((((uint32_t) startAddr) + offset) % regionOADAttrs.sectorSize) == 0)
    {
        for(i=0; i<4; i++)
        {
            status = NVS_erase(curOADHandle,(size_t)(i*64*regionOADAttrs.sectorSize), (size_t)(64*regionOADAttrs.sectorSize));
        }
        displayDebug1("Division == 0, erase = %x", (size_t)(4*64*regionOADAttrs.sectorSize));
    }

    The loop of 4 was then determined experimental!

    We run the 4011 instead of the 4111 but at this error there is no difference as far as we know!

    But actually we are now trying to get the bootcode to run if we build the c-array ourselves?

    regards,
    Laurent

  • Hello Laurent,

    We will need some time to review this and get back to you. You can expect a follow by 8/3 at the latest. 

  • Part Number: MSP432P401R

    Hi,

    we started project and used oad_firmware_update_401R/4111/4011 projects in 2019. As a first gola we we tested with sdk's combined with the CC2640 sdk. Added and adapted lots of funtionality and BLE services. Alll works well. We have a BLE(CC2640) module ad multiple msp4011 and a MSP430FR6047 in two interconnected (RS485) custom boards we are now are almost finished we want to startusing the bootloader source code. And thats were we ran into confusion and trouble!

    First challenge: We imported from 'Simplelink_sdk_le_plugin_3_20_00_24' the projects 'oad_bootloader_source_MSP_EXP432P401R/EXP432P4111. Boot won't build flawless since the file 'bl_int_flash_sm.c' is presnt twice in both these projects depending loading both at once or seperately!!?? We removed the once which occured in the root.

    When removed 'oad_bootloader_source_MSP_EXP432P401R_nortos_ccs' still has an error! It doesn;t like:

    void Reset_Handler(void), r181 in 'startup_msp432p404r_ccs.c'

    we renamed it to, same as in 4111 source project void resetISR(void), assuming this is ok?

    We repeated this with a fresh new workspace!

    Then, after everything a least builds we compare boot aod_bootloader.c files. We the see that with the 401R project we can find the 'transferKey' in the c-array but in the 4111 oad_bootloader.c we c401R bootc

    oad_bootloader,c from oad_firmware_update_MSP_EXP432P401R, transfer key found both in oad_boootloader and oad_update firmware!

    oad_bootloader.c from oad_firmware_update_MSP_EXP432P4111, no transferKey 

    In the resulting txt file from the oad_bootloader_source_MSP_EXP432P4111 the transferkey is also present in both txt and c-array!

    However, in the oad_firmware_update_MSP_EXP432P4111 it is a complete different c-array!!!! No transferkey can be found either. This bootloader does work however and is identical to the one we always used. However we don't have the source code because we couldn't fin dit!

    Can we get the correct source project from the 4111 project?

    kind regards,

    Laurent

  • Hello Laurent,

    I joined these threads together since they are around the same subject/issue. We should still be on track to follow up with you today. 

  • Hi Laurent,

    Thank you for pointing out the build issues with the oad_bootloader_source project. I will file a bug for that.

    For the source that is in oad_bootloader.c from oad_firmware_update_MSP_EXP432P4111, it looks like it is using a hex array from an optimized build of the oad_bootloader_source_MSP_EXP432P4111 project. Although the transferKey is not explicitly listed in here because of the optimization, it should still be able to work.

    The source that is in oad_bootloader.c from oad_firmware_update_MSP_EXP432P401R project seems to be from a lower optimized build, which is why you can explicitly see the transferKey in the hex array.

    However you can build the hex array yourself for the oad_bootloader_source_MSP_EXP432P4111 project.

    1. In the oad_bootloader_source_MSP_EXP432P4111 project properties ensure that optimizations are low or turned off completely.

    2. Still in the project properties, enable output of the TI-TXT hex file.

    3. Build the oad_bootloader_source_MSP_EXP432P4111 project. Find the generated oad_bootloader_source_MSP_EXP432P4111_nortos_ccs.txt in the project under the Debug folder. In this txt file you can confirm the transferKey is listed in here.

    4. Take this file, and copy it to your srec_cat install folder. In a command prompt in the srec_cat folder, run the srec_cat tool to convert from TI TXT format to C Array format:

    srec_cat.exe oad_bootloader_source_MSP_EXP432P4111_nortos_ccs.txt -ti_txt -o oad_c_array_image.c −ca

    5. In the newly created oad_c_array_image.c file, you now have the hex array that can be copied and pasted into oad_bootloader.c in the oad_firmware_update_MSP_EXP432P4111_tirtos_ccs project.

    Let me know if you have any issues generating the hex source, and if this solves your issue.

    Best regards,

    Kristen 

  • Hi,

    the problem was in:

    startup_msp432p4x1x_ccs.c (maybe in other examples of the sdk too!)

    the reset interrupthandle need to be replaced:

    i.e. replace 'Reset_Handler' with 'resetISR'(declared downwards in this file!

    This solved my problem!

    Thanks for you help/assistance.

    rgds, Laurent