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.

Code doesn't start on reset / power-cycle.

Other Parts Discussed in Thread: UNIFLASH

I have a problem where my code no longer starts after a target power cycle or reset.

It works okay on debug and when first installed via jtag -- just doesn't survive a reset / power cycle.

Everything was working fine until about a week ago and since then this problem has been present.

I'm using CC1252R1 (Launch-XL) as programmer/debug and CC1352R2 (LPSTK) as the target.  I've tried multiple modules (both target and xds110) and that doesn't help.

It doesn't run my code but the same thing happens when running a selection of demo/example code via resource explorer.

I was running CCS10.11 but have upgraded to 11.10 and the problem persists.  I'm using the simplelink cc135x 26x2 sdk version 5.20.00.52.

The problem exists on the 11.10 install which is 'clean', ie, I've only tried the demo/example code (project zero, sensor/collector, etc) and I've not changed any settings.

The same thing happens whether config is set to debug or release (I've not changed their params nor added any other build config).

I'm using Ubuntu 20.04LTS.

The CCS has updated the firmware on the XDS110 (ie, in the Launch-XL) to whatever it said was 'most recent'.

Is there a simple config switch that might cause this effect?  

  • To add, the compiled code will install and work correctly when installed via uniflash.  Is it writing to ram when I load?  Is there a switch in the config to get it back to writing to flash?

  • Not sure if I understand the latest comment:

    - Do you mean that if you use CCS and CCS flash the target it doesn't work when you reset but if you take the .out file CCS generate and flash the target with this the target runs after a reset? 

    ---

    - Do you see any difference if you use rfCarrierWave or the empty example? The latter one uses the 32 kHz oscillator. A typical issue with similar symptoms as you have is that the 32 kHz does not work/ is not selected. The former example doesn't go into standby and hence the 32 kHz is not an issue.  Hence this test will tell if it's a problem related to this. 

    Both CCS and Uniflah does the same thing, it store the resulting file in flash. 

  • First bit is right -- CCS doesn't seem to be flashing the target, but the .out file works in uniflash.

    I'll try the rfcarrierwave and empty examples (I've not tested on those yet).  Thanks.

  • Have you tried to read back the flash content using Uniflash when you flash the device with CCS and compare it with when you read back after flash with Uniflash? The resulting hex file should be equal but for some reason it seams not to be the case? 

  • I'll try that first.  I've got some stupid meetings to get out of the way first.

  • Right.  I had a think about a few aspects of this over the weekend and have just tried them out.  It seems to be a BIM thing -- I was clearly using the factory BIM, had wiped it out using NVS writes and have restored functionality by rewriting the BIM.  This leads to new questions that I can't find answers to -- does anyone know of a good tech note about what BIM is actually doing re. the boot sequence and CCS?

    What are the sequences (CCS switches) for booting -- as far as I can tell, there's:

    • 'enable bootloader' in syscfg -- this seems to instruct the bootstrap (not BIM) to look in off-chip flash for code and is thus a red-herring.
    • OAD_IMG_x=y (linker preprocessor) seems to instruct the build/flasher to put the code in the onchip or offchip flash.  x can be A, B or E, indicating onchip slot 1, offchip slot 2 or external flash.  But what does the 'y' signify?
    • More on OAD_IMG -- I think that if I don't have one of these then I don't use BIM -- is this the case? 
    • FLASH_ROM_BUILD (compiler predefined symbols) is all about whether to use the ROM BLE where possible, or just create all BLE functions in the compiled code -- thus is a red-herring.  However, there's also a FLASH_ROM_BUILD=x in the linker preprocessor -- what does the 'x' do?
    • FLASH (linker preprocessor) doesn't appear to be documented.
    • It isn't clear what SECRET (linker preprocessor) does -- does it mangle the code in some way?  Is it a BIM thing, a bootstrap thing or a flash-protection (read deny) thing?
    • Are there other important switches for the use of BIM?

    The main question is -- I don't need the BIM as I don't need OAS -- can I have the rom boostrap point simply to code in on-chip flash when using TIRTOS?  The docs imply (but don't state) that I can't do this, but I don't understand why.  I can't stick with BIM and on-chip as my code exceeds the 60K limit for on-chip.

    Also -- a weird thing.  I accidentally used BIM (off chip) when testing using code compiled with OAS_IMG_A=1 -- but it still worked.  Have I misunderstood OAS_IMG_A or does BIM (off chip) also look on-chip if it can't find anything in off-chip flash?

    Thanks.

  • Before going into the details with your questions:

    From what you write I get the understanding that you for some reason use BIM but are not planning to use OAD.

    - Could you cover some on why you are using BIM if not needed?

    - Could you cover what sort of project you are trying to implement? 

    I want to understand a bit on a high level what you need and are trying to do before going into details 

  • It is a simple bluetooth data transmitter.  It uses the usual rtos functions (clock based intermittent BLE data send if connected).

    We didn't use bim on purpose -- I was under the impression (mistakenly) that the bim was in the bootstrap, and was unavoidable.

    We also based the probject on prjzero; this has worked out well, other than the point about all the compiler switches being to use bim -- really I just want to know which switches to change to move from bim to code run from the bootstrap.

    We'd prefer not to use bim as it doesn't add anything.

    Thanks for your time on this.

  • Hi,

    If I understand you correctly, you want to base your application on Project Zero but you want to remove the Over the Air firmware upgrade (OAD) compatibility (including BIM). 

    1) First of all, it may be easier to base your project on Simple Peripheral. If there are certain services from Project Zero you like (e.g. LED service) you can add that service to Simple Peripheral.

    https://dev.ti.com/tirex/explore/node?node=AHupI5sIgV0YGLPXw6gtdg__BSEc4rl__LATEST 

    2) Secondly, if you program the CC1352R1 LPSTK with an image which is not OAD compatible, you will need a debugger and JTAG wire to program it. 

    3) You asked if we have a tech note on how BIM works. We have a section dedicated to BIM in our BLE Stack User's Guide: (Your LPSTK comes preprogrammed with the BIM for Off-Chip OAD)

    https://dev.ti.com/tirex/explore/content/simplelink_cc13xx_cc26xx_sdk_5_40_00_40/docs/ble5stack/ble_user_guide/html/oad-secure/bim.html 

    Cheers,

    Marie H

  • Okay.  All resolved.  It wasn't too tough to make Prjzero non-OAD/BIM.

    The code was simple enough -- just remove references to OAD functions.  Note that there's a switch in main.c that mucks things up 'USEOAD' -- the only way I found to resolve this was to comment out the #ifdef USEOAD (and the endif).

    Beyond the code, the main problem was getting the memory map to work -- the simple peripheral memory map in the .cfg works well enough.  I'd note a problem (that threw me for a few hours) was that CCS doesn't actually look for a named .cfg but just picks the first .cfg it finds, traversing directories if necessary.  The only solution is to only have one .cfg and don't do as I did and think that renaming the .cfg will work.

    It would be easy enough for TI to produce a document stating the steps needed to move projzero to non-OAD -- you make it sound much harder than it is.

    Cheers.

  • Hi,

    Thank you for posting the solution!

    Cheers,

    Marie H