cancel
Showing results for 
Search instead for 
Did you mean: 

SPC564Axx OS-Less Test Application problem

stmicro239955_st
Associate II
Posted on June 07, 2013 at 23:37

Hi All,

I am unable to get the sample application to run on the dev board.

Setup: 

1. SPC56xxMB/XPC56xxMB (they are identical according to the schematics)

2. SPC564AADPT324S/XPC564AADPT324S (they also are identical according to the schematics)

Problem:

1. LEDs do not flash

2. Using the BDM debugger (P&E Micro USB Multilink PPC Nexus) I can see that the SIU.PCR and eMIOS.CCR registers are not configured correctly. In fact they appear to have the default values in them. I actually have my own app running on this board under CodeWarrior so I know that the board works and what the correct SIU.PCR and eMIOS.CCR values should be.

Observations:

I am wondering if the problem is in the chip configuration. The board I received came with a MPC5644A/SPC564A80B4. (To make it even more confusing, it seems that Freescale has just changed the part number on their part to SPC5644A!)

In platform.h  _SPC564A70L7_ is defined and in application.ld the MEMORY directive is incorrect for the 564A80B4. However, changing them to values for the 564A80B4 did not help.

If the chip config is the problem I would be glad to try and correct it if someone can point me, at least in the general direction, of the files that should be modified. I am still just not experienced enough with the SPC5 Studio way of doing things to find everything by myself.

Of course it may be something else all together:)

Cheers

Kevin
10 REPLIES 10
disirio2
Senior
Posted on June 09, 2013 at 08:54

Hi,

I can confirm that there is a problem with SPC564A70 devices. The demos work correctly using SPC560A80 devices. The bug has already been fixed on the SPC5-HAL repository: https://sourceforge.net/projects/spc5-hal/

If you want to patch your SPC4Studio 1.1 installation find the file hal_lld.c under C:\SPC5Studio\eclipse\plugins\org.chibios.spc5.components.hal.platform.spc564axx_....\component\lib\src\

then comment out the initialization of FLASH_B and XBAR as follow:

//  FLASH_B.BIUCR.R  = SPC5_FLASH_BIUCR | SPC5_FLASH_WS;

//  FLASH_B.BIUCR2.R = 0;

//  XBAR.MPR0.R = 0x34000021;

//  XBAR.MPR2.R = 0x34000021;

The problem will be fixed in the next update pack for SPC5Studio (end of June).

Giovanni

stmicro239955_st
Associate II
Posted on June 09, 2013 at 23:01

Hi  Giovanni,

I commented out the lines that you recommended. The LEDs still do not flash or light.

I cannot find anywhere in the code where the SIU.PCR and eMIOS.CCR registers are set to the values necessary to light the LEDs. The only thing that I have been able to find so far is in pal_lld.c where during init all of the SIU.PCR registers are set to a default value. I have been unable to find anywhere that the eMIOS lines are configured or set.

According to the 56xxMB schematics, the 4 LEDs on the motherboard are eMIOS 9,10, 11,12. This corresponds to SIU.PCR[188-191].R. The correct value of these registers should be 0x0600.

EMIOS.CH[9].CCR.R = 0x00000001 and EMIOS.CH[10].CCR.R = 0x00000081 turns on the LEDs and turns off the LEDs respectively.

Can you tell me which files do the initialization and set the values for the SIU and eMIOS modules?

Posted on June 10, 2013 at 09:15

Hi Kevin,

I just re-tested the application in SPC5Studio 1.1 after doing those changes and it works. Is it possible that your board is not configured to light the LEDs? look at the jumpers group J7, those should all be inserted.

About the demo, the LED flashing is not done using EMIOS but the GPIO mode of the pins. The pins are configured in the Board Component, the default values are generated into (from the Eclipse project explorer) components/spc5_hal_spc564axx_hal_board_initialization_component/cfg/board.c

The code performing the PCR initialization is that function in pal_lld.c that you already found, that function reads the settings generated in board.c.

About the EMIOS, it will be handled by the PWM and ICU drivers that will be present in version 1.2.

ciao,

Giovanni

stmicro239955_st
Associate II
Posted on June 11, 2013 at 23:24

Hi Giovanni

First, let me thank you for all the help you have given, I hope that my questions are generic enough to be of help to others.

Still cannot get the OS-less test app to work. The LEDs light up properly in the bareboard application that I wrote and all of the board jumper configs are the factory defaults. 

The test app is failing very early in the boot sequence. Using the built-in CodeWarrior debugger, which I must confess I am completely unfamiliar with, I can see that the Program Counter (PC) stops at 0x42. This is only 8 or 9 instructions into the program. When the PC reaches that point, the LC register shows 0x0badbad0. Forcing the PC further, something that you can do with CW, causes CTR and XER to report runtime errors.

It seems that the compiler is not producing the correct code for my setup.

A few questions;

1. Is the test app compiling with VLE or BookE?

2. Recall that I have the MPC5644A/SPC564A80B4, not the SPC564A70. Could this be causing a problem?

3. Since I actually have the MPC5644A, reading SIU.MIDR will report back the chip as 'MPC5644A mask 10'. Could this be causing a problem?

Thanks again for all your help, I really would like to get this up and running as I am quite anxious to try ChibiOS.

Posted on June 12, 2013 at 11:42

Hi,

The application is compiled using VLE by default.

If you have the A80 the all the above workarounds are not even needed, the application should work as-is, there is something else preventing it to work.

You could go under the configuration of the application and change the device to A80, then ''re-generate'' and recompile, just in case the problem is related to the different memory sizes.

Nowhere in the code the ''ST-ness'' of the device is checked, it should work also on the FSL silicon.

Is the mini-module you have the one with the external memory? I never tested that one, the problem could be related to that.

Giovanni

stmicro239955_st
Associate II
Posted on June 15, 2013 at 00:35

Hi Giovanni,

Still can't get it working but I have been taking a closer look at the binary.

1. I did reconfigure the application to use the 80B4 part. Did not make any difference.

2. I do have the 324 pin part. It's mini-module does have 2 pads for external memory. The pad for the flash chip is empty. The pad for the external sram is populated with a 1 MByte chip. The external ram is located @ 0x20000000. This in theory allows for 512 MBytes of external memory before it runs into the internal sram. The schematic shows address lines ADDR12-31 and CS0, WE0, and WE1 also being used. Don't know if this could be a problem or not.

3. Looking at memory with my BDM, something doesn't seem right with how the binary is layed out in memory. I would like to explore this more before I go into too much boring detail here. Could you post your out.bin to this forum? I would like to compare it to mine.

4. Don't know if is of interest to anyone but I modified the Makefile and rules.mk to output a Motorola srec (.mot) in addition to the regular outputs. This can be very useful for us Motorola/Freescale folks. If you like I could post the modified files here or however you would wish to get them. 

stmicro239955_st
Associate II
Posted on June 18, 2013 at 06:42

Hi, Giovanni,

If you could post a copy of your out.elf and out.bin it would be very helpful.

Thanks in advance.

Kevin 

Posted on June 18, 2013 at 15:18

Hi Kevin,

I successfully tested the application on the SPC564A80 with BGA package. The problem is that the default demo is configured for the LQFP package mini module which mounts an 8MHz crystal, the BGA mini module has a 40MHz crystal so the demo fails on initialization.

You need to reconfigure the frequency in the board component to 40MHz and then the FMPLL pre-divider to 10 in the drivers component.

Attached there is the No-OS application already reconfigured and compiled (elf and map files inside).

Note that I used the ST mini module because BGA devices have different balls placement between ST and FSL, please verify your mini module frequencies.

ciao,

Giovanni

________________

Attachments :

SPC564Axx_OS-Less_Test_Application.7z : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006qapV&d=%2Fa%2F0X0000000bpD%2Fv9ZPJ_sg_9xKV6_QpBxpFdurJZ4aezXxDht5tABBTIA&asPdf=false
stmicro239955_st
Associate II
Posted on June 19, 2013 at 00:59

Hi Giovanni,

Success! 

The OS-less demo works great. 

Once I had recompiled the project on my machine and had it running I immediately built the ChibiOS demo. It also works perfectly. 

Thanks for all of your help. I look forward to using ChibiOS in my next project.

Kevin