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.

FLASH-PROGRAMMER: Batch error

Part Number: FLASH-PROGRAMMER
Other Parts Discussed in Thread: ASH, CC2630, CC2538

I have create other post which is closed, https://e2e.ti.com/support/wireless_connectivity/low_power_rf_tools/f/155/p/628401/2318899#2318899

but I have a problem.

I used command

srfprog -t soc(XDS-00000000,cc2630) -p -f 4bytes.bin -a 0x1FFA0 -rs none

but there is a error


Texas Instruments SmartRF Flash Programmer 2 v1.7.5-windows
-------------------------------------------------------------------------------

Reading file: E:\Industrialisation\XCMW radio\trunk\Outils\Programmation avec XD
S100\4bytes.bin.
2%le size: 4 bytes.
Number of assigned pages: 1.
Less than 1 percent of the file contain assigned code.
Start flash programming ...
99%
Flash loader reported an error (4)

Error occured at addr: 0x0001FFA0, writing 76 bytes.
Failed to write 76 bytes to address 0x0001FFA0.
write memory
read memory

Texas Instruments SmartRF Flash Programmer 2 v1.7.5-windows
-------------------------------------------------------------------------------

Start reading flash...
100%

Address | Data

---------|------------------------------------------------

0001FFA0 | 00 00 00 00

---------|------------------------------------------------


OK
Appuyez sur une touche pour continuer...

4bytes.7z

  • Hi Nicolas,

    What do you see if you do a "srfprog -ls auto"?

    You should see something along the lines of:

    Connected devices:
    ------------------
    0 Device: XDS110, ID:XDS-00000000
              Chip: CC2630
    
    1 Device: XDS110 Class Application/User UART (COM8), ID:COM8
              Chip: Unknown

    Note that ID and chip name of "0 Device" should match with the arguments of "soc(XDS-00000000,cc2630)".

    I tried flashing your binary myself and it worked fine. 

  • Microsoft Windows [version 6.1.7601]
    Copyright (c) 2009 Microsoft Corporation. Tous droits réservés.

    C:\Users\sesa144348>cd C:\Program Files (x86)\Texas Instruments\SmartRF Tools\Fl
    ash Programmer 2\bin

    C:\Program Files (x86)\Texas Instruments\SmartRF Tools\Flash Programmer 2\bin>sr
    fprog.exe -ls auto

    Texas Instruments SmartRF Flash Programmer 2 v1.7.5-windows
    -------------------------------------------------------------------------------


    -------------------------------------------------------------------------------

     Connected devices:

     ------------------

     0 Device: XDS110, ID:XDS-00000000,

               Chip: CC2630

     1 Device: Serial Port for Barcode Scanner (COM6), ID:COM6,

               Chip: Unknown

     2 Device: Prolific USB-to-Serial Comm Port (COM5), ID:COM5,

               Chip: Unknown

     3 Device: Intel(R) Active Management Technology - SOL (COM3), ID:COM3,

               Chip: Unknown

     4 Device: Lien sÚrie sur Bluetooth standard (COM10), ID:COM10,

               Chip: Unknown

     5 Device: Lien sÚrie sur Bluetooth standard (COM9), ID:COM9,

               Chip: Unknown

     6 Device: TI CC2538 USB CDC Serial Port (COM4), ID:COM4,

               Chip: Unknown

     7 Device: XDS110 Class Application/User UART (COM7), ID:COM7,

               Chip: Unknown

    -------------------------------------------------------------------------------

    C:\Program Files (x86)\Texas Instruments\SmartRF Tools\Flash Programmer 2\bin>

  • For your information : if i used this batch
    echo Erase all
    %PATH% -t soc(XDS-00000000,cc2630) -e all -rs none
    echo write file
    %PATH% -t lsidx(0) -p -v -f E:\Industrialisation\XCMW radio\trunk\Outils\Programmation avec XDS100\XCMW_v1.0.out -rs none
    REM echo write memory

    REM %PATH% -t soc(XDS-00000000,cc2630) -p -f E:\Industrialisation\XCMW radio\trunk\Outils\Programmation avec XDS100\4bytes.bin -addr 0x1FFA0 -rs none
    REM echo write memory
    %PATH% -t soc(XDS-00000000,cc2630) -w addr(0x1FFA0,1)=0x12 -rs none
    echo write memory
    %PATH% -t soc(XDS-00000000,cc2630) -w addr(0x1FFA1,1)=0x56 -rs none
    echo write memory
    %PATH% -t soc(XDS-00000000,cc2630) -w addr(0x1FFA2,1)=0x98 -rs none
    echo write memory
    %PATH% -t soc(XDS-00000000,cc2630) -w addr(0x1FFA3,1)=0xF5 -rs none
    echo read memory
    REM %PATH% -t soc(XDS-00000000,cc2630) -r addr(0x1FFA0,4)

    pause


    It's Ok
    Erase all

    Texas Instruments SmartRF Flash Programmer 2 v1.7.5-windows
    -------------------------------------------------------------------------------

    Start flash erase ...


    OK
    write file

    Texas Instruments SmartRF Flash Programmer 2 v1.7.5-windows
    -------------------------------------------------------------------------------

    Reading file: E:\Industrialisation\XCMW radio\trunk\Outils\Programmation avec XD
    S100\XCMW_v1.0.out.
    Start flash programming ...
    100%

    OK

    Start flash verify ...
    0%
    Skip verification of unassigned page: 8.
    Skip verification of unassigned page: 9.
    Skip verification of unassigned page: 10.
    Skip verification of unassigned page: 11.
    Skip verification of unassigned page: 12.
    Skip verification of unassigned page: 13.
    Skip verification of unassigned page: 14.
    Skip verification of unassigned page: 15.
    Skip verification of unassigned page: 16.
    Skip verification of unassigned page: 17.
    Skip verification of unassigned page: 18.
    Skip verification of unassigned page: 19.
    Skip verification of unassigned page: 20.
    Skip verification of unassigned page: 21.
    Skip verification of unassigned page: 22.
    Skip verification of unassigned page: 23.
    Skip verification of unassigned page: 24.
    Skip verification of unassigned page: 25.
    Skip verification of unassigned page: 26.
    Skip verification of unassigned page: 27.
    Skip verification of unassigned page: 28.
    Skip verification of unassigned page: 29.
    0%ip verification of unassigned page: 30.
    3%ge: 0 verified OK.
    6%ge: 1 verified OK.
    9%ge: 2 verified OK.
    12%e: 3 verified OK.
    15%e: 4 verified OK.
    18%e: 5 verified OK.
    21%e: 6 verified OK.
    96%e: 7 verified OK.
    100%: 31 verified OK.

    OK

    Texas Instruments SmartRF Flash Programmer 2 v1.7.5-windows
    -------------------------------------------------------------------------------

    Start flash programming ...
    96%%

    OK
    write memory

    Texas Instruments SmartRF Flash Programmer 2 v1.7.5-windows
    -------------------------------------------------------------------------------

    Start flash programming ...
    96%%

    OK
    write memory

    Texas Instruments SmartRF Flash Programmer 2 v1.7.5-windows
    -------------------------------------------------------------------------------

    Start flash programming ...
    96%%

    OK
    write memory

    Texas Instruments SmartRF Flash Programmer 2 v1.7.5-windows
    -------------------------------------------------------------------------------

    Start flash programming ...
    96%%

    OK
    read memory
    Appuyez sur une touche pour continuer...
  • Can you do a Forced Mass Erase of the device and try flashing it again?
    A Forced Mass Erase can be done in the Flash Programmer 2 GUI. Click on the wrench symbol in the upper right corner, and choosing the "CC26xx/CC13xx Forced Mass Erase".
  • I have made CC26xx/CC13xx Forced Mass Erase
    but there is the same problem
  • Texas Instruments SmartRF Flash Programmer 2 v1.7.5-windows
    -------------------------------------------------------------------------------

    Reading file: E:\Industrialisation\XCMW radio\trunk\Outils\Programmation avec XD
    S100\4bytes.bin.
    2%le size: 4 bytes.
    Number of assigned pages: 1.
    Less than 1 percent of the file contain assigned code.
    Start flash programming ...
    99%
    Flash loader reported an error (4)

    Error occured at addr: 0x0001FFA0, writing 76 bytes.
    Failed to write 76 bytes to address 0x0001FFA0.


    Why the programmer want rpogram 76 bytes. In my file there is 4 Bytes
  • What you are missing is the "-e pif" argument before "-p", e.g.

    srfprog -t soc(XDS-00000000,cc2630) -e pif -p -f 4bytes.bin -a 0x1FFA0 -rs none

    "-e pif" means "erase pages in source file".

    The problem is when the memory area you are trying to write to is not erased (0xFF) or not the same byte value as what you are trying to write. This mismatch causes a write fail when you only program (-p). The solution is to erase pages you are writing to (-e pif) when programming.

    I managed to reproduce your error, and adding "-e pif" solved the issue.

  • Ok it's seem to be Ok thanks.
    Before put this message in resolved
    I have a last question
    Actualy, i run these command
    echo Erase all
    %PATH% -t soc(XDS-00000000,cc2630) -e all -rs none
    echo write file
    %PATH% -t soc(XDS-00000000,cc2630) -p -v -f E:\Industrialisation\XCMW radio\trunk\Outils\Programmation avec XDS100\XCMW_v1.0.out -rs none
    REM echo write memory

    %PATH% -t soc(XDS-00000000,cc2630) -e pif -p -f E:\Industrialisation\XCMW radio\trunk\Outils\Programmation avec XDS100\4bytes.bin -a 0x1FFA0 -rs none

    I want increase speed of action
    if I suppress
    echo Erase all
    %PATH% -t soc(XDS-00000000,cc2630) -e all -rs none
    and I add -e pif in
    echo write file
    %PATH% -t soc(XDS-00000000,cc2630) -p -v -f E:\Industrialisation\XCMW radio\trunk\Outils\Programmation avec XDS100\XCMW_v1.0.out
    is it The same action?
    My programmation will be OK?
  • I think you'd want the "-e all" instead of "-e pif" for the file programming, as you probably don't want any data flashed on the device other than the file written. "-e pif" would only erase pages the file would be written to, meaning any old data left in pages not overwritten by the file programming would be left untouched. "-e all" erases these as well.

    So to summarize:
    It is safe to remove "Erase all" step if you add "-e all" to the write file step.
  • Ok I will used
    echo write file
    %PATH% -t soc(XDS-00000000,cc2630) -e all -p -v -f E:\Industrialisation\XCMW radio\trunk\Outils\Programmation avec XDS100\XCMW_v1.0.out -rs none
    REM echo write memory

    %PATH% -t soc(XDS-00000000,cc2630) -e all -p -f E:\Industrialisation\XCMW radio\trunk\Outils\Programmation avec XDS100\4bytes.bin -a 0x1FFA0 -rs none

    this action during 42second, have you a solution to reduce this time?
  • You should not do "-e all" when writing to memory. This would erase all pages that the file has been written to in the previous step.

    Program file step: "-e all"
    Write to memory step: "-e pif"

    There isn't much you can do to reduce time here. The only step that isn't "needed" is the verification step (-v), which you are doing when programming the file. You could constrain verification to only verify pages in source file with a CRC check (-v crc pif) instead of all pages.

    This is something you can play around with and see what affects the run-time the most.

  • Ok thanks for your help
  • in fact it doesn't work

    echo write file
    %PATH% -t soc(XDS-00000000,cc2630) -e all -p -v -f E:\Industrialisation\XCMW radio\trunk\Outils\Programmation avec XDS100\XCMW_v1.0.out -rs none
    REM echo write memory

    %PATH% -t soc(XDS-00000000,cc2630) -e pif -p -v -f E:\Industrialisation\XCMW radio\trunk\Outils\Programmation avec XDS100\4bytes.bin -a 0x1FFA0 -rs none
    REM echo write memory

    But there are différences a programation with GUI and my Soft

  • Ok I understand my firmware have value in the same page but when I erase page with -e pif it's erase also my value!!!
    I will try to erase this zone in with my program.out
  • So if I'm understanding you correctly you want to patch CCFG with these 4 bytes. This is not so easily supported with srfprog.

    I can see two possible solutions:

    1. You patch the XCMW_v1.0.out file with these 4 bytes before you program the device. This way, the 4 bytes are already patched in CCFG.

    2. You write each byte at a time with the (-w) flag, just as you have done in the original script.

    There are currently no support to patch (read-modify-write) an already programmed device with multiple bytes with srfprog. Only single byte patching with -w addr(0x<addr>,<length>=0x<value> is supported.

    I would highly suggest you to try the solution #1, as this would be much faster than solution #2. Solution #1 would only do a single connect/program/disconnect, while #2 would do a connect/read-modify-write/disconnect (times 4 in your case).

    Hope this clears things up.