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.

How to change SPC in HET program

Hi,

I would like to have a fixed structure (at end of HET RAM) for status exchange between the HET program and the CPU software. Is there a way to use the SPC in a .space directive, like in:

; ... (my HET program)

; fails with E0200: Operation cannot be performed on given operands

 .space HET_RAM_SIZE - MYSTRUCT_SIZE - $

; also fails with E0200: Operation cannot be performed on given operands

here .space HET_RAM_SIZE - MYSTRUCT_SIZE - here

MyStruct:

; ... ( some HET instructions whose data fields are accessed from CPU software)

Or should I rather put this structure at beginning of HET RAM (past an initial branch instruction)?

Oh, by the way, what is the unit of the SPC : bytes, words or HET instructions?

Thanks and Best Regards,

Daniel Marmier

 

  • Hello Daniel,

    In section 2.2 of the HET Assembler User Guide, www.ti.com/.../spnu490, it gives the following example of the use of the .space directive to reserve space to initialize a constant.

    As you can see, the format is "label .space x" where label is a label pointing to the first byte of the reserved space and x is the number of bytes to reserve. Alternatively, you could also use the .bes directive. The only difference is that the label will point to the last byte in the reserved space.

    Note that this directive does not allow you to define the location of the space. The space will be defined within the current section. If you are wanting this placed at the end of another HET program, you may be able to use the .copy or .include directives to append the space for the data repository to another program.

  • Hi Chuck,

    I was looking for a directive to move the SPC to an absolute (not relative) address. It seems that .HDA would do exactly that, but using it results in the following crash log:

    Problem signature:
    Problem Event Name: APPCRASH
    Application Name: hetp.exe
    Application Version: 0.0.0.0
    Application Timestamp: 4d81e8e9
    Fault Module Name: hetp.exe
    Fault Module Version: 0.0.0.0
    Fault Module Timestamp: 4d81e8e9
    Exception Code: c0000005
    Exception Offset: 0001587c
    OS Version: 6.1.7601.2.1.0.256.48
    Locale ID: 2055
    Additional Information 1: 423e
    Additional Information 2: 423e82f584f5b7ebbdf11c7b6d8d17f0
    Additional Information 3: 8d82
    Additional Information 4: 8d82f84b84c42789bdbc2ecec2e8835a

    Thanks and Best Regards,

    Daniel Marmier
  • Daniel:

    I don't yet have an answer for you last question; however, my understanding of what you are trying to accomplish is to place a struct of data that is to be accessed by the CPU so that status or data can be passed to the main application software. Correct?

    If this is the case, why would you not simply use the HTU to access the data directly in the HET RAM instead of with the CPU. When the CPU is used it can cause disruption to either the access or to program execution due to the CPU access. If the HTU is used, this obtrusive read is lessoned and the data can be transferred directly out of HET RAM into SRAM for access by the main application software. This is the main intent of the HTU.
  • Hello Daniel,

      I'm not too sure your purpose to create some empty spaces between instructions. I did a simple example using .space and I was able to assemble. What would you want to do with the empty spaces in between?

    L00   CNT { next=L01,reg=A,max=10};
    reserved .space 64 ; reserve 64 bytes of space
    L01   ECMP { next=L00,en_pin_action=ON,cond_addr=L00,pin=0,action=PULSEHI,reg=A,irq=ON,data=5};

    The compiled .hnc file has the below contents.

    .sect ".HETCODE" 
    	.word 0x00006C20 
    	.word 0x0000000A 
    	.word 0x00000000 
    	.word 0x00000000 
    	.word 0x00000000 
    	.word 0x00000000 
    	.word 0x00000000 
    	.word 0x00000000 
    	.word 0x00000000 
    	.word 0x00000000 
    	.word 0x00000000 
    	.word 0x00000000 
    	.word 0x00000000 
    	.word 0x00000000 
    	.word 0x00000000 
    	.word 0x00000000 
    	.word 0x00000000 
    	.word 0x00000000 
    	.word 0x00000000 
    	.word 0x00000000 
    	.word 0x00000000 
    	.word 0x00400019 
    	.word 0x00000280 
    	.word 0x00000000 
    

     

     

  • Hi Charles,

    I do not want to do something with the spaces between. I wanted to have some data slots at fix locations near the end of the HET memory; their program and control fields are irrelevant (they are not executed, only used as remote locations). The .space directive does not allow this (it is relative, and only accepts a constant as parameter; i.e. it is not possible to write ".space ABS_HET_ADDR - $". Hence I tried the ".HDA" directive which should do exactly this, but that caused hetp.exe to crash.

    In the meantime, I have switched to another solution, but independently of what I am trying to do, there seems to be a bug in the handling of the ".HDA" directive, and I thought it might be helpful to report it.

    Best Regards,

    Daniel Marmier

  • Hi Chuck,

    Correct! I want to have some status words that can be read from the CPU. I do not use HTU because it will only be read periodically (about 20 milliseconds), so disruption is not a concern and I prefer keeping the HTU request slots for higher bandwidth data.

    Best Regards,

    Daniel Marmier
  • Hello Daniel,

      Could you send your HET code  so we can report the problem to our HET assembler team? 

  • Hi Charles,

    A one-liner is enough:

    .HDA 0x3E0

    (or anything higher than 0x3E4) crashes hetp.exe with the error reported in the former crash log.

    .HDA 0x10

    (or anything greater than current PC and smaller than 0x3E4) crashes HET.exe during loading of the program with the following error :

    Problem signature:
    Problem Event Name: APPCRASH
    Application Name: HET.exe
    Application Version: 0.0.0.0
    Application Timestamp: 560aabd7
    Fault Module Name: QtCore4.dll
    Fault Module Version: 4.6.2.0
    Fault Module Timestamp: 4b7cda63
    Exception Code: c0000005
    Exception Offset: 0001ea86
    OS Version: 6.1.7601.2.1.0.256.48
    Locale ID: 2055
    Additional Information 1: 0a9e
    Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
    Additional Information 3: 0a9e
    Additional Information 4: 0a9e372d3b4ad19135b953a78882e789

    By the way, the units of the SPC and .HDA directive are undocumented, and seem to be half HET instructions (8 bytes), which is quite strange (with regard to .space, which is byte oriented)

    Best Regards,

    Daniel Marmier