MPC 5604 B data logger

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MPC 5604 B data logger

1,560 Views
jatinarora
Contributor I

I am working on a data logging project using MPC 5604 B 32 bit uC based on power PC architecture. I am done with the data acquisition part( like interfacing sensors to ADC, eMIOS, etc.), whats left is storing data to uSD card. I cant find any fat library for power PC. Can anyone direct me to the right one.

 

Also i tried porting SD Card Reader using the S08JM MCU familyhttp://www.freescale.com/webapp/sps/site/training_information.jsp?code=WBNR_SDCARDREADER_S08JM  fat library to my power pc 32 bit uC and here are the problems I am facing.

1. Re: Problems porting SD FAT to MCF51 JM Badge Board - Datalogger application , this thread is about the problems of above library and the main problem people point at is struct. alignment.


The soln. is to change/set struct. alignment to byte otherwise a particaular routine of fat library (get master block in fat.c) used crashes, and for me the code is stuck up in the same fat library routine(get master block in fat.c) and no file is actually created in SD card, so I assume that this is the problem i am facing.

can anyone guide me how to change struct alignment on codewarrior for power pc and does power pc actually allow the same.


I tried to do it and in struct alignment option of EPPC processor setting in flash settings i get 3 options

a. 64K

b. 64K 4 byte

c. Power pc... when i used anything other than option c, all my peripherals like SIUL and DSPI stop working.

 

2. The thread also talks about endian support, my uC originally works on Big endian, when i try to change it to little endian in EPPC target settings in flash settings, I recieve an error "cannot mix little and big endian".

Labels (1)
Tags (2)
0 Kudos
8 Replies

817 Views
trytohelp
NXP Employee
NXP Employee

Hi Jatin,

Can I ask you the tool version you're using:

      - CW for MCP55xx/56xx V2.10 based on classic IDE,

      - CW for MCU V10.x based on Eclipse.

CW for MCU V10.6 has been released yesterday.

This is the last  version.

Regards

Pascal

0 Kudos

817 Views
jatinarora
Contributor I

Hello Pascal,

I am using CW for MCP55xx/56xx V2.10 based on classic IDE for my project.



0 Kudos

817 Views
trytohelp
NXP Employee
NXP Employee

Hi Jatin,

Not sure this will answer your question.

CW for MPC55xx/56xx V2.10 is the last version.

This tool supports big/little endian.

By default when a project is created, the big endian mode is selected.

This means the libraries included in the project were created with Big endian option too.

If you want to change to little endian you must:

      - change the option,

      - change the libraries.

I've created a project example.

This project contains 2 targets:

      -> Big Endian - this is the default project,

      -> Little Endian.

To build the Little Endian target, you must:

      - change the compiler option for Bate Ordering to Little endian,

      - add 2 new libraries to replace default big endian ones

            a- Runtime.PPCEABI.VS.UC.a replaced by Runtime.PPCEABI.N.LE.UC.a

            b- MSL_C.PPCEABI.bare.VS.UC.a  replaced by MSL_C.PPCEABI.bare.N.LE.UC.a

Now I can build the little endian application.

Attached you will find the example I've created.

Hope this will help you.

Pascal

817 Views
tanmayeesapre
Contributor II

I am facing a similar issue but with CW 10.7.  I changed the compiler and linker settings to use little endian and also updated the MPC5643l_HWInit.h file. The MPC5643L_HWInit.c file assumes big endian as the default setting and configures the memory accordingly. Is there a similar default init routine for little endian setting? Also are there any other files I need to change?

0 Kudos

817 Views
jatinarora
Contributor I

Hello Pascal,

I will definitely try this and see if it works for me.

Also, I need to change struct. alignment to byte as mentioned in my question (that also creates a major problem for me). Please guide me to do the same.

Also, Please guide me to Fat library made for Power PC for Sd card interfacing (if any exists)

Thanks a lot for help.

0 Kudos

817 Views
trytohelp
NXP Employee
NXP Employee

Hi Jatin,

A colleague provided you more info regarding the structure alignment.

Regarding the FAT library, I think the solution could be based with the MQX library.

MQX contains MQX MFS Files.

When linked to the user application, the MFS library enables the application to access FAT12, FAT16, or FAT32-formatted drives.

There are examples for that:

      1- bootloader_vybrid

            Shows how to load application images from FAT system on SD card or flash QSPI boot loader and application images to QSPI Flash memory with SD boot loader.

      2- bootloader_vybrid_qspixip

            Shows how the QSPI boot loader boots from the QSPI flash memory and loads application images from FAT file system on SD card or the raw image data from the flash memory.

 

you can access the MQX installer through the Freescale web site:

      http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MQX

Unfortunately the MPC5604B device is not supported.

Regards

Pascal

0 Kudos

817 Views
jatinarora
Contributor I

Also, when I tried to debug my project using the little endian libraries you provided (after changing CW setting to lttle endian), "error 18 during script" occurred while programming the uC using CPROGPPCZ programmer.

Also, I need to change struct. alignment to byte as mentioned in my question (that also creates a major problem for me). Please guide me to do the same.

0 Kudos

817 Views
stanish
NXP Employee
NXP Employee

Hello Jatin,

in order to change struct alignment to 1Byte I'd recommend you to add the pragma below to the struct definitions:

#pragma push

#pragma pack(1)

typedef struct

{

char a;

int  b;

char c;

}t_my_struct0;

typedef struct

{

char c;

int  d;

char e;

}t_my_struct1;

#pragma pop

Hope it helps.

Stan

0 Kudos