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.

InstaSPIN with TI RTOS (SYSBIOS)

Other Parts Discussed in Thread: TMS320F28062, SYSBIOS, TMS320F28069Dear TI team and TI Users, I currently use my own board with InstaSPIN FOC to control a PM motor. I used the InstaSPIN Project Labs and also the RTOS Labs and everything worked well. Now I'm trying to use both InstaSPIN and RTOS together. I defined the HWI's, SWI's and some Tasks. But depending on which Linker Comand File I use, I get the following Errors: With F28069.cmd #10099-D program will not fit into available memory. run placement with alignment/blocking fails for section ".stack" size 0x400 page 1. Available memory ranges: F28069.cmd /SWPI-RTOS-InstaSPIN line 129 C/C++Problem When I use the Files TMS320F28062.cmd and F2806x_Headers_BIOS.cmd: I can Build the program, but when I run it, it always crashes and goes in exit.c. Could someone provide me an minimal example of InstaSPIN and RTOS, or knows where the problem might be? I would be very grateful for your help. Greetings
  • Yassin,

    I suspect some of the section from TI RTOS are not being allocated correctly when you build with the F28062.cmd file. My recommendation is to use the default bios linker command files and modify them. I'm not entirely sure where they reside, so I'm going to move this post to the RTOS forum where they can better assist you.

    BR,
  • Hi Yassin,

    What version of SYS/BIOS are you using ? Assuming you are on SYS/BIOS 6.40 or newer, you can find our example linker cmd file for F28069 at the following location in your BIOS installation: C:\ti\bios_6_4x_xx_xx\packages\ti\platforms\tms320x28\include

    If you are using an older version of SYS/BIOS then you will need to get the linker cmd files from the corresponding XDC/Tools. Here's the location in the XDC/Tools installation: C:\ti\xdctools_3_2x_xx_xx\packages\ti\platforms\tms320x28\include

    Try building the app with this linker cmd file and let us know if it builds and runs now.

    Best,
    Ashish
  • Hi Ashish, thank you very much for your support.

    I'm using TI RTOS C2000 2.10.01.38 with SYSBIOS 6.41.00.26. I followed your advise and used the linker cmd file TMS320F28069 under: C:\ti\tirtos_c2000_2_10_01_38\products\bios_6_41_00_26\packages\ti\platforms\tms320x28\include

    When I use this File I can build the programm, but not run it. When I try to run it, I get in the Console:
    C28xx: Loader: One or more sections of your program falls into a memory region that is not writable. These regions will not actually be written to the target. Check your linker configuration and/or memory map.

    I tryed again with the TMS320F28062 linker cmd File, but the programm still chrashes and goes into exit.c.

    Greetings Yassin
  • Hi Yassin,

    Can you share the map file that got generated when you built your project ?

    Best,
    Ashish
  • Hi Ashish,


    when I use the TMS320F28069.cmd File I get SWPI-RTOS-InstaSPIN-1.map and by

    using the TMS320F28062.cmd File I get SWPI-RTOS-InstaSPIN-2.map

    Thank you

    Greetings Yassin


    4265.SWPI-RTOS-InstaSPIN Files.zip

  • Hi Yassin,

    The map file for 28069 looks ok. I dont see any section being placed outside the memory map or in RO memory. I was looking at your earlier posts and dont see you mention which chip you have on your custom board ? Is it a F28069 or a F28062 ? Both these chips have different amounts of RAM. If one builds using 28069's linker script and attempts to load the program on a 28062, you can see load errors like the one you are seeing.

    If you have a F28062, then please get F28062's linker script from the BIOS installation and try building and running with that. If you still see a crash, please share the callstack in the debug window. This should help determine what triggered the crash. In addition, you may also want to look at the callstack for each of the tasks in ROV's Task view.

    Best,
    Ashish
  • Hi Ashish,

    sorry last week I didn't worked on this project.

    I didn't mentioned that I'm using a TMS320F28062 on my own board.
    On my own board I used the F28069F_ram_lnk.cmd File for InstaSPIN Labs and everything worked well.
    Then I tryied to implement an RTOS and blink some LED, for this I used the TMS320F28062.cmd File from the RTOS Example. Also this worked well.
    Now I'm trying to use both InstaSPIN and RTOS. The problem is both Linker Command Files don't work.

    With the F28069F_ram_lnk.cmd File I get:
    <a href="file:/c:/ti/ccsv6/tools/compiler/dmed/HTML/10099.html">#10099-D</a> program will not fit into available memory. run placement with alignment/blocking fails for section "UNION_1" size 0x100 page 1 F2806x_Headers_BIOS.cmd /SWPI-RTOS-InstaSPIN line 114 C/C++ Problem
    <a href="file:/c:/ti/ccsv6/tools/compiler/dmed/HTML/10099.html">#10099-D</a> program will not fit into available memory. placement with alignment/blocking fails for section ".cinit" size 0x593 page 0. Available memory ranges: F28069F_ram_lnk.cmd /SWPI-RTOS-InstaSPIN line 113 C/C++ Problem

    With the TMS320F28062.cmd File I have the problem that the programm goes into exit.c.
    In the callstack I have this:
    -0x000000 (no symbols are defined for 0x000000)
    -FLASH_getStandbyWaitCount(struct _FLASH_Obj_ *)() at flash.c:160 0x0097BD
    -ti_sysbios_family_c28_Hwi_unPluggedInterrupt__I() at Hwi.c:1'009 0x3EC690
    -xdc_runtime_Error_raiseX__E(struct xdc_runtime_Error_Block *, unsigned short, char *, int, unsigned long, long, long)() at Error.c:114 0x3ED388
    -xdc_runtime_Error_policyDefault__E(struct xdc_runtime_Error_Block *, unsigned short, char *, int, unsigned long, long, long)() at Error.c:165 0x3EB682
    -xdc_runtime_System_abort__E(char *)() at System.c:100 0x3ED4C0
    -xdc_runtime_System_abortStd__E() at System.c:141 0x3ED72C
    -abort() at exit.c:93 0x3ED180


    Is there a Minimalexamlpe of InstaSPIN and RTOS? Or a Linker Comand File which works with both?

    Thank you for your support
    Greetings Yassin
  • Hi Yassin,

    Yassin Kelay said:
    Hi Ashish,

    I didn't mentioned that I'm using a TMS320F28062 on my own board.
    On my own board I used the F28069F_ram_lnk.cmd File for InstaSPIN Labs and everything worked well.

    You may have gotten lucky with the F28069 linker file. I am guessing the InstaSPIN lab examples dont use too much RAM and so did not try to use addresses outside F28062's memory map.

    I would recommend using F28062 linker files only.

    Yassin Kelay said:


    With the TMS320F28062.cmd File I have the problem that the programm goes into exit.c.
    In the callstack I have this:
    -0x000000 (no symbols are defined for 0x000000)
    -FLASH_getStandbyWaitCount(struct _FLASH_Obj_ *)() at flash.c:160 0x0097BD
    -ti_sysbios_family_c28_Hwi_unPluggedInterrupt__I() at Hwi.c:1'009 0x3EC690
    -xdc_runtime_Error_raiseX__E(struct xdc_runtime_Error_Block *, unsigned short, char *, int, unsigned long, long, long)() at Error.c:114 0x3ED388
    -xdc_runtime_Error_policyDefault__E(struct xdc_runtime_Error_Block *, unsigned short, char *, int, unsigned long, long, long)() at Error.c:165 0x3EB682
    -xdc_runtime_System_abort__E(char *)() at System.c:100 0x3ED4C0
    -xdc_runtime_System_abortStd__E() at System.c:141 0x3ED72C
    -abort() at exit.c:93 0x3ED180
     

    This is helpful. So, it looks like a spurious interrupt is causing the crash. Do you get some print messages on the console ? The Hwi_unPluggedInterrupt__I() function is suppose to print the spurious interrupt number. If you are not seeing any prints then you can always put a breakpoint at ti_sysbios_family_c28_Hwi_unPluggedInterrupt__I and step through the code to determine the interrupt number being computed and passed to Error_raise().

    Yassin Kelay said:

    Is there a Minimalexamlpe of InstaSPIN and RTOS? Or a Linker Comand File which works with both?

    I unfortunately am not aware of any such examples from TI. I found a forum thread where someone has shared their InstaSpin+SYS/BIOS minimal example. You may want to check it out: http://e2e.ti.com/support/microcontrollers/c2000/f/902/t/340939

    Best,

    Ashish