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.

AM3359: Flash tool

Part Number: AM3359
Other Parts Discussed in Thread: UNIFLASH,

Hello,

Do anyone know if there's a tool like Uniflash that can be used to flash am335x without using Code Composer ?

Thanks a lot

Laurence

  • Hi Laurence,

    just in case you have not yet discovered all Uniflash-related options let me summarize those:

    There is a version of Uniflash bundled with the TI Processor SDK RTOS that will allow you to Flash AM3359-based devices using a UART-based process. Step one would be loading the flash programmer firmware through UART boot (this step can also be done through Code Composer, but one only needs to use a single method really), and step two would be feeding your image to the flash programmer firmware also via UART, which will then program it into SPI Flash devices (you could add support for other Flash devices). See here for more info:

    http://software-dl.ti.com/processor-sdk-rtos/esd/docs/latest/rtos/index_board.html?highlight=dslite#uniflash

    There is also an older version of Uniflash that directly supports AM335x and also allows for Ethernet-based programming, which would be significantly faster. I have not used this tool however and I was told it is not compatible with Windows 10. But it still is actively being used by customers:

    http://processors.wiki.ti.com/index.php/CCS_UniFlash_v3.4.1_Release_Notes

    If you really want a tool OTHER than Uniflash I'm not aware of any at the moment, however that doesn't mean such tools don't exist. Also sometimes it could be workable (and a lot faster) to pre-program memory devices prior to assembly (at least with a bootloader, if IP protection at the PCB manufacturer is a concern), or have provisions like test points on the board for in-system programming of Flash memory to be performed later.

    Regards, Andreas

  • Hello Andreas,

    Thanks for your answer.

    In fact, we are using windows 10 so I think your 2nd solution is not ok for us.

    Concerning the 1st solution, I will have a look at it but on our industrial card we are talking about removing the UART canal so I'm not very happy with this solution.

    However, we are still able to use the JTAG connection and I've seen that uniflash 5.0 is compatible with ARM3359 if we are using it with a command line (not with GUI). I've tried it but my configuration file .ccmxl seems to have an error. Can you confirm me that this programming way is ok and, if it is, help me to understand what is not working with my config ?

    Thanks a lot

    Laurence

  • Hi Laurence,

    Cazaban Laurence said:
    However, we are still able to use the JTAG connection and I've seen that uniflash 5.0 is compatible with ARM3359 if we are using it with a command line (not with GUI).

    In theory you can use the command line which really means leveraging a technology we call DSS (Debug Server Scripting) to do anything you can do through the CCS GUI as both share the same foundations.

    Cazaban Laurence said:
    I've tried it but my configuration file .ccmxl seems to have an error.

    Can you share what specific error you got (logs, screen shots, etc.)

    As far as I understand that even if you use JTAG to load the flash programmer firmware into the device you would still have to use UART to feed the actual image to the flash programmer firmware as this is how the current version of Uniflash works, so there will be a UART connection required nevertheless in addition to JTAG.

    What other interfaces do you have available on your board? Which memory device are you trying to program? For example you could do the following:

    • If you have Ethernet, then boot directly from Ethernet into U-Boot, and use U-Boot for programming. Use CONFIG_NETCONSOLE to remote-control U-Boot to do the programming, or
    • If you have USB, then similar to above, but use Ethernet-over-USB

    If you really want a JTAG-only solution only using TI-provided pieces that is rather universal, in theory one could do something like the below, but since such a solution currently doesn't exist the effort to implement/validate such a solution in a robust manner it would be high I think:

    1. Use DSS to load and run SPL and then U-Boot both via JTAG, based on the steps documented at http://processors.wiki.ti.com/index.php/Sitara_Linux_Training:_uboot_linux_debug_with_ccsv5 or a variation thereof
    2. Use DSS to load the binary image (or a piece of it) to DDR via JTAG
    3. Start and remotely operate U-Boot via JTAG to do the actual programming (CONFIG_JTAG_CONSOLE)

    Regards, Andreas

  • Thnaks for your help !

    You can find in attachment the error log I have when I test my config file in UNIFLAH GUI and the error log when I use my config file in Uniflash with comand line.

    Can you tell me what happens ?

    Thanks foru your help.

    I will try other solutions later

    Regards

    Laurence

  • Hi Andrea,

    I fact, You have developped a little program that implement the FOE dowload in a boot program.

    So, what we want to do is:

    - download a boot program via JTAG in a specific flash adress

    - download a little monitor program via JTAG in another specific flash adress :  this program includes FOE transfer

    - download our client program via FOE in another speacific flash adress

    So, for the first use, the card is programmed in the fabricant with the boot program and the monitir program with JTAG.

    Then, afeter that, we can download client program with FOE.

    Do you understand what I mean ?

    So, I'm looking for an industrial solution to download boot+monitor program with JTAG.

    Is it clean ?

    Laurence

  • Hi Laurence,

    Cazaban Laurence said:

    You can find in attachment the error log I have when I test my config file in UNIFLAH GUI and the error log when I use my config file in Uniflash with comand line.

    Can you tell me what happens ?

    Thanks foru your help.

    I've not seen this specific error with Uniflash but it points to some basic JTAG connectivity issue. Do you have a TI EVM you could try this with rather than your own board? Perhaps some circuitry is holding the device in reset? You could also try using Code Composer Studio directly (latest version) to see if you can establish a connection with you AM335x, this would help making sure your JTAG and debugger setup is basically working, as Uniflash uses the same foundation. Then, maybe your JTAG debugger needs a firmware update (the pieces to do that are part of the CCS installation)? There is also a new Uniflash version v5.2 that was just released early November that you should try (http://www.ti.com/tool/download/UNIFLASH), as you are still on version 5.0.0 it seems.

    Regards, Andreas

  • Cazaban Laurence said:

    So, for the first use, the card is programmed in the fabricant with the boot program and the monitir program with JTAG.

    Then, afeter that, we can download client program with FOE.

    Do you understand what I mean ?

    So, I'm looking for an industrial solution to download boot+monitor program with JTAG.

    Yes I think I understand what you are trying to do. I'm not convinced that JTAG and Uniflash is generally a good approach here to program your first two pieces (for reasons of speed, complexity, and robustness of the overall solution) hence my question earlier what other interfaces you have available that could be used to boot the device from for purposes of Flash programming via U-Boot, but it doesn't mean such a JTAG-based solution can't be made work.

    However a couple of clarifying questions...

    What Flash device have you connected to your AM335x, and how is it connected to the chip?

    Is your hardware design related / derived from a TI AM335x design of sorts (which one?)

    How big are the images you are trying to program, specifically your custom bootloader from step 2?

    Regards, Andreas

  • Hello Andreas,

     

    Concerning your questions :

    1/ We use a 256Mb Flash device. It is the component N25Q256. This flash is connected to the SPI0 port of the processor. Here is the schema of the connection:

    2/ Our board is based on a Icev2 design but we have modify it a lot

    3/ Concerning our programs size :

    -          The boot program size is 32ko.

    -          The ethercat mini program size is 196ko

    Furthermore, I still don’t understand my connection problem with JTAG. If I use JTAG with the same ccxml config file in Code Composer everything is ok. If I use JTAG with the same ccxml file to load a program with uniflah comman line : it is ok. But I use the same config file to flash, there’s a problem. Do you have an idea ?

    Thanks a lot for your help

    Laurence

  • Furthermore, the log error is the following:

    "Connecting...
    error: M3_wakeupSS: Trouble Halting Target CPU: (Error -1266 @ 0x0) Device is held in reset. Take the device out of reset, and retry the operation. (Emulation package 8.3.0.00003)
    Failed: Target must be connected before calling the function"

    But I dont want to connect M3_wakeupSS, I want to connect CortxA8 !!!

    And I don't know where I can modify this connection....

  • Hello Andreas,

    Finally, I found what was my problem with my ccxml file: I only have to specify thta I bypass The M6_wakeupSS  !

    Now, I manage to load my program via JTAG in a command line with Uniflash:

    dslite --mode load --config=D:\Users\l.cazaban\Projets\Pilotage\6_Products\CNumDsp2015\src\NewAxisDriver\targetConfigs\ICE_AM3359_2.ccxml D:\Users\l.cazaban\Projets\Pilotage\6_Products\CNumDsp2015\src\bootLectra\boot_release\bootLectra_m3.out

    I can see that the program is corrcetly loaded and runs well

    Now, I would like to flash the .bin correspoding to this program at the offset 0x0000:

    dslite --mode flash --config=D:\Users\l.cazaban\Projets\Pilotage\6_Products\CNumDsp2015\src\NewAxisDriver\targetConfigs\ICE_AM3359_2.ccxml D:\Users\l.cazaban\Projets\Pilotage\6_Products\CNumDsp2015\src\bootLectra\boot_release\bootLectra_m3_ti.bin,0x0000

    I have the following error:

    error: CortxA8: Trouble Writing Memory Block at 0x0 on Page 0 of Length 0x7ff0: (Error -1065 @ 0x3D5A) Unable to access device memory. Verify that the memory address is in valid memory. If error persists, confirm configuration, power-cycle board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 8.3.0.00003)
    error: CortxA8: File Loader: Verification failed: Target failed to write 0x00000000

    Can you explain me what is not working ?

    Thanks for your help

    Laurence

     

  • The entire log error is:

    error: CortxA8: Trouble Writing Memory Block at 0x0 on Page 0 of Length 0x7ff0: (Error -1065 @ 0x3D5A) Unable to access device memory. Verify that the memory address is in valid memory. If error persists, confirm configuration, power-cycle board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 8.3.0.00003)
    error: CortxA8: File Loader: Verification failed: Target failed to write 0x00000000
    E_RPCENV_IO_ERROR(-6) No connection: DTC_IO_Send::dtc_io
    E_RPCENV_IO_ERROR(-6) No connection: DTC_IO_Send::dtc_io
    E_RPCENV_IO_ERROR(-6) No connection: DTC_IO_Send::dtc_io
    E_RPCENV_IO_ERROR(-6) No connection: DTC_IO_Send::dtc_io
    E_RPCENV_IO_ERROR(-6) No connection: DTC_IO_Send::dtc_io
    E_RPCENV_IO_ERROR(-6) No connection: DTC_IO_Send::dtc_io
    Failed: File: D:\Users\l.cazaban\Projets\Pilotage\6_Products\CNumDsp2015\src\bootLectra\boot_release\bootLectra_m3_ti.bin: Load failed.

  • Hi Laurence,

    thanks for the additional findings & updates. I'm currently out of the office (Thanksgiving holiday) but will have a close look on Monday and report back.

    Regards, Andreas

  • Hi Laurance,

    Cazaban Laurence said:

    Now, I would like to flash the .bin correspoding to this program at the offset 0x0000:

    dslite --mode flash .....

    I can see that you are trying to use the "flash" mode to load your custom binary however this mode is not supported for AMxxx type of devices. Typically this mode is used only on devices with embedded Flash memory such as MCUs, not on devices requiring external flash memory such as AMxxx. I tried to explain earlier but the way Uniflash on AMxxx type devices works is even after you load/start the Flash programming firmware through JTAG such as by doing...

    # cd <path_to_the_uniflash>
    # dslite.bat --mode load --config=<Path_to_ccxml_file>
    dslite.bat --mode load --config=C:\Users\username\ti\CCSTargetConfigurations\iceAMIC110.ccxml -f C:\ti\pdk\packages\ti\board\utils\uniflash\bin\iceAMIC110\uart_iceAMIC110_flash_programmer.out -n 1

    ...you will then still need to feed the actual image you want to program through the serial port, which is how the TI-provided flasher firmwares expect the image to get delivered. The proper mode for this second step will be "--mode processor", see http://software-dl.ti.com/processor-sdk-rtos/esd/docs/latest/rtos/index_board.html#uniflash for the details. Again, you would be using both JTAG and UART in such a scenario.

    If you really want to use JTAG to do everything it will involve creating a custom solution. As an alternative to the U-Boot based custom JTAG solution I described earlier you could also update the TI-provided firmware to accept your firmware image via JTAG rather than UART. The source code for this flash programmer firmware is part of the TI Processor SDK RTOS for AM335x and can be found under <install_dir>/pdk_am335x_1_0_16/packages/ti/board/utils/uniflash. I had a quick look, the issue I see however that this firmware already uses almost all of the device's internal RAM (128KB) for code and data structures, leaving little room for adding buffers to receive data via JTAG. So either you would need to chunk your data to be programmed as it transitions over JTAG (load a few KBs, program those, load the next few KBs, program tbose, etc) or setup and use DDR to receive a larger image which can then be program in one run into the external Flash memory. These are all rather advanced topics involving both embedded (programmer firmware) and host-side coding (CCS debug server scripting), and I'm not sure how much time/energy you want to spend on such a custom solution. Hence the suggestion earlier to utilize Ethernet or USB.

    You cold also just bring out the signals to your external Flash chip (SPI flash I suppose) through test points and program it in-system through a tool like https://www.totalphase.com/products/aardvark-i2cspi/ or https://www.totalphase.com/products/cheetah-spi/ while holding the processor in reset (so that there is no signal contention on the SPI lines). I've done that before and it is probably the most straightforward and fastest/robust way to go about the whole thing.

    Regards,
    Andreas

  • Thanks a lot Andreas.

    I will have a look at your solutions and I will give you a feedback later.

    Thanks a lot again.

    Regards,

    Laurence