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.

HTU example (SPNA130A) on TMS570LS04: forever looping in _memoryInit_

Other Parts Discussed in Thread: HALCOGEN

I'm testing HTU on the Hercules Launchpad with TMS570LS04.

I have downloaded the HTU example project from the link given in spna130a.pdf :
http://www.ti.com/lit/zip/spna130
and imported the project in CCSV6 ( Version: 6.0.0.00190 )

In project properties, I set the Variant to TMS570LS043x, and connection to the XDS100V2 USB emulator. All other options left untouched. I built the project, and that went ok without errors or warnings.

I started the debug, and the program doesn't break in the main() function as usual. It shows running. When I suspend the debug session, it's always looping in the mloop of _memoryInit_: in file sys_memory.asm

Is there an action that I should take in my project settings or code to make it work with the launchpad? Or did you have a similar issue when testing this app note?

  • Jan,

    The date on the appnote is fairly old and probably did not consider the LS04.

    Normally I'd hope to see the HalCoGen project files in the .zip but I can see they are not there,  so I don't know how to  figure out which part # they were generated for.

    But probably it's a bigger part like the LS3137 ...  based on the date.

    The memory init has a bit mask in it corresponding to various physical arrays of memory on the chip.  If the code is checking for memory that doesn't exist to finish initializing then it wouldn't exit this loop.  That it likely what is going on since the LS04 has many fewer arrays to initialize than the larger hercules part.

    HalCoGen parameterizes / abstracts these things for you at generation time so you will need to regenerate all this startup code - which is probably the right thing to do anyway.   Then you'd need to patch in the actual 'meat' of the example into your generated framework for the LS04.   

    Sorry about that confusion.

  • I'm going to follow your advice. I'll try this:

    • generate a fresh project with HALCoGen 4.0, with HET driver enabled,
    • add the HET IDE generated files from the ZIP (or re-generate them, it's only two lines of source)
    • look for the pieces of code between USER CODE BEGIN and END tags and move them over.
    • try to find how the NHET pin10 signal is generated in that example (likely done in HALCoGen and not in a USER CODE block, so it's going to be a bit tricky to find it back)

    If I succeed,  I'll report back with a working example for this launchpad.


    If there is a more recent tutorial to NHET/HTU (other than the PWM example in Project0 and the youtube videos) , it would be great to get a pointer to that. I find this the most difficult part of the hercules/launchpad platform to grasp with the online info available.

  • I have successfully completed this.

    I used the .het file of the SPNA130A zip file,
    extracted the sources from that archive's sys_main.c, het.c and htu.c files,

    and renamed some registers to fit latest HALCoGen (htuCPRAM to htuRAM1, htuREG to htuREG1, hetREG to hetREG1),
    and took care that the code from the zip file's hetInit() and htuInit() was called.

    I tested in both single buffer and dual buffer mode

    Zip project attached:

    5545.HTU_Example_TMS570ls04.zip

  • Hello Jan,

    Thanks for posting this. I assume you are the same person that is on U-toob - good job on that!

    Best Regards,
    John W.