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.

osal_snv_init() fails

Other Parts Discussed in Thread: CC2541, CC2540

Using exactly the same code on two different CC42541 hardware boards , osal_snv_init() is failing when calling initNV( )in osal_snv.c.  

The call chain is: main()->osal_snv_init() ->initNV( )->cleanErasedPage()->erasePage().

then erasePage() calls first HalFlashErase() and then HalFlashRead() to compare the read value with 0XFF which is value expected after erase.However the value returned is 0x70. therefore it sets the failF = TRUE;

Otherwise both boards works fine. There are no other issues with the software.

Is there a custom version of the CC2541 that does not support snv operations ?

 

  • Hi,

    Have you tried to erase the flash of the "broken" board with smartRF flash programmer?

  • Hi Igor,

    Yes, several times. I also read the flash to a file after erase and it is all 0XFF. So it is erased correct. However when I program the chip again, it is probably overwritten while it should not. The chips must be different, but again smartRF Flash programmer reports CC2541 on both. After the failed initialization(as described in my first post) also other functions are failing (Osal_snv_read and Osal_snv_write).

  • Well,

    Regarding the chips, read the info page with smartRF flash programmer and compare with each other. Also look at the plastic packages of these chips and see if both printings states the same.

    You should see something like that:

    First row: CC2540

    Second row: F256

    Third row: TI 21J

    Fourth row: P665 G4 (G4 should be underlined)

  • The information pages are different (apart from the MAC address that must be different).

     

  • Itamar Cohen said:
    The chip that do not work(no direct sign that this is a CC2541):

    That is very odd!

    Let's see what TI's representatives have to say about this.

  • Any news TI ?

    Just as  reminder and a bit more info:

    I got two boards (A and B) both with CC2541

    I use the same program on both.

    On board  A everything works as it should

    On board B functions osal_snv_init, osal_snv_read and osal_snv_write  fails and nothing is being saved on the chip.

    (return NV_OPER_FAILED;)

    Checking some xdata on the chips reviles the following differences :

    Definitions:

    __xdata __no_init uint8 ChipVer[2] @ 0x6249;
    __xdata __no_init uint8 ChipInfo[2] @ 0x6276;

    CC2541 on Board A (works as it should)
    CHVER Chip version at 0x6249  returns 0x13
    CHIPID Chip identification at 0x624A returns 0x41
    CHIPINFO0 Chip information byte 0 at 0x6276  returns 0x44
    CHIPINFO1 Chip information byte 1 at 0x6277  returns 0x1F
    CC2541 on Board B (failing)
    CHVER Chip version at 0x6249  returns 0x12
    CHIPID Chip identification at 0x624A returns 0x41
    CHIPINFO0 Chip information byte 0 at 0x6276  returns 0x34
    CHIPINFO1 Chip information byte 1 at 0x6277  returns 0x1F
    I have several units from each type but with the same results (so it is not an individual error)
    My be these are two different silicon versions where the nv area was moved on one of them?
  • Hi Itmar, 

    I think the key is in the CHIPINFO0 difference. The devices that fail NVinit are 128 KB Flash versions. The NV pages are located towards the top of the available flash, so that's why it fails. The flash size should be clearly marked on the packag as well, but it does not look like it for your case. Where did you get these chips? Could you post a picture of the package marking? 

    Peder

  • Hi Itmar, 

    If there's no 128KB target in the drop-down list in the project you are working on, you should follow the instructions here to make a 128KB image:

    http://processors.wiki.ti.com/index.php/128kproject

    I would of course be interested in knowing where you got the chip. The markings don't correspond too well with ours. 

    Peder

  • Hi Peder

    Thanks a lot for your suggestion.  It solved my problem. I followed the 128 project instructions and now the snv subsystem works. It also works on a 256 parts so it could not be better. Regarding the chip source, I got it from china on a ready made board, from somebody that got it from another one in China. Since I don't speak chinese, It will be difficult for me to trace it all the way back.

    Thanks again, it really helped me.

  • The markings on this chip are the same as the markings found on the Bluetooth Smart chip used in the Gimbal beacons.  A custom version of the CC2541?

    Lee