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.

Code Migration to a SYSBIOS Project. Why compiles but doesn't work?

Other Parts Discussed in Thread: TMS320F28335, SYSBIOS

Hello. I am developing a code to control some MOSFETs for a Power converter. The code works fine but now I have to control one more converter with the same DSP (TMS320F28335) so I wanted to just use some threads for multitasking both controllers. As long as I read, I guess SYSBIOS is compatible with the DSP I am using, at least it compiles the examples. Now the problem comes when I want to migrate the code I had to the new project (I started from an example that just creates a task). I copied all my functions to the new main.c , copied the controller part inside the task etc. I had a bunch of error sure, I solved them linking the same files I had in the previous project so the compiler doesn't give any error just a bunch of same warnings ("creating output section "AdcRegsFile" without a SECTIONS specification") and so on with different names. When I run the code it seems it's working, even I pause it and it's where it has to be (inside the controlling task all time), but the hardware of the DSP (ePWM module) is not responding...... Is anything I did wrong??

Thanks.

Carlos.

  • If the compiler is creating a section for the ADC register file without a section specified, then it is going to map the ADC registers to some arbitrary location where there is free space (instead of to the hardware ADC register locations).  The result is that when you do something like

    AdcRegs.ADCSOC0CTL.bit.CHSEL = 3;

    The runtime is assigning 3 to some random memory location, not the hardware register.  Similarly, when you try to configure the PWMs, you are not telling the PWMs to do anything, you are just flipping random bits in RAM.

    I think you will need to eliminate those warnings for the project to work.   

  • That makes much sense Devin :) thanks a lot, I'll try to fix it. Do you know if I need any heather file for that? I included the ones I needed before

  • I think the hardware registers are mapped to the correct locations in control suite examples in the file 

    F28xxx_Headers_nonBIOS.cmd

    Obviously you don't want to use the non-bios file for your project.  I think there is also a bios version included in control suite that you need to include.

  • Yep, that was it! There's the Headres_BIOS.cmd but there's still no definition for something called "ramfuncs" which still has no sections... and somehow when I run the program suddenly it gets stuck in an infinite loop of the default interrupt of Timer-2 which I'm not using.