Debug a project which is using the SPT on S32R274

cancel
Showing results for 
Search instead for 
Did you mean: 

Debug a project which is using the SPT on S32R274

559 Views
Contributor II

Hi,

I am currently importing a project into S32 Studio, which was before compiled and also running when using standard Eclipse, GHS and a Lauterbach-Programmer.

I changed now everything to use the S32Studio and use the GCC compiler and it also compiles and is able to run on the hardware. Until the initialisaiton of the SPT. The commands are written in the SPT buffer, but the SPT does not process them anymore. (i wait for the flag SPT_CS_STATUS0 to get 1, which never happens.)

Flashing the old .elf files of the GHS compiler with the "USB Multilink FX" results still in a running device, so flashing is not the problem.

Do you have any suggestions to find out why the SPT does not run anymore?

I read about a grafical SPT programmer. Could it be a problem, because I am not using it, but instead using the self coded commands?

Thanks for your response.

Best regards,

Roger

0 Kudos
3 Replies

4 Views
NXP Employee
NXP Employee

Hi Roger, 

I had similar issue couple months ago - I was able write into SPT registers - but SPT gets stuck when was started. This was caused by wrongly configured clock. In attachment is MCU_INIT.c generic file and here is my HW configuration used with SPT: 

void hw_init()
{
MC_MODE_INIT(); /* Configure Modules Via Mode Entry */
CLK_OUT(); /* Enable Clk Out */
OSC_INIT (); /* Configure Osc */
PLL_INIT_0(); /* Configure PLL 0 */
SET_SYS_CLK(); /* Set the system clk */
CGM_INIT (); /* Configure Clocks */
xcptn_xmpl (); /* Configure and Enable Interrupts */
SPT.CS_STATUS0.R = 0xFFffffff; // RESET all status register
SPT.GBL_CTRL.R = 0x0; // RESET Ctrl
}

Jiri

0 Kudos

4 Views
Contributor II

Hi Jiri,

Thanks for your answer and the files. Some other got higher importance, therefore the delayed answer.

I already had something similar for initialization, but to make sure, it is not a clock problem, i used your code instead. I still have the same issue.

After some further research I found that an .spt section is created in the linker script file, do I have to use this in code, to make the SPT work again?

Does the debugger in S32 autmatically drive the SPT in it's debug mode?

Thanks and best regards,

Roger

0 Kudos

4 Views
Contributor II

Hi Jiri,

After some time I found the problem.

When loading commands/coefficients to the SPT, the arrays must be alligned.

Changing the array definition to:

uint32_t fft256_command_list[] __attribute__ ((aligned (8))) = { ... };

made the SPT working.

Best regards,

Roger

0 Kudos