5746R-144pin can not start

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

5746R-144pin can not start

1,522 Views
changchen
Contributor II

hi all,

I download the source code into the EVB ,but the code is not be excused ,and it can not reach the main() at all, how can I solve this  problem ?

thank you!

Labels (1)
Tags (1)
0 Kudos
6 Replies

1,171 Views
martin_kovar
NXP Employee
NXP Employee

Hi,

could you please share the project you loaded to MPC5746R and describe you problem in detail?

Without the knowledge of the code and with your general description, I am not able to tell you, what is wrong. It could be million reasons, why your code does not run correct.

Regards,

Martin

0 Kudos

1,171 Views
changchen
Contributor II

Firstly Thanks for your answer. Today I found that  when I add the code 'SIUL2.MSCR0_255[61].B.SSS=0;   SIUL2.MSCR0_255[61].B.ODC=2;
 SIUL2.GPDO[61].R=0;  '  the code would not be excused. if I delete these code  .the code could be excused normally.

int main(void)
{
volatile int counter = 0;

xcptn_xmpl (); /* Configure and Enable Interrupts */


MC_ME.RUN_PC[0].B.DRUN = 1; //Enable DRUN mode for all peripherals using ME_RUN_PC[0]

// SIUL2.MSCR0_255[61].B.SSS=0;
// SIUL2.MSCR0_255[61].B.ODC=2;
// SIUL2.GPDO[61].R=0;

/* Loop forever */
for(;;) {
counter++;
}

0 Kudos

1,171 Views
stanish
NXP Employee
NXP Employee

Hello Chang,

You are probably using older version of the tools - v1.0.

This issue (ENGR00374776) has been addressed in the version 1.1. The project has enabled -fstrict-volatile-bitfields by default. It causes that the compiler generates 32-bit store even if you access it this way:

SIUL2.MSCR_IO[0].B.ODC = 0x2;
14: 71 40 60 00 e_li r10,-262144
18: 51 2a 02 40 e_lwz r9,576(r10)
1c: 71 00 00 02 e_li r8,2
20: 75 09 c1 4e e_rlwimi r9,r8,24,5,7
24: 55 2a 02 40 e_stw r9,576(r10)
SIUL2.MSCR_IO[0].B.SSS = 0x2;
28: 71 40 60 00 e_li r10,-262144
2c: 51 2a 02 40 e_lwz r9,576(r10)
30: 71 00 00 02 e_li r8,2
34: 75 09 06 3e e_rlwimi r9,r8,0,24,31
38: 55 2a 02 40 e_stw r9,576(r10)

Therefore I'd strongly recommend you to use the latest version of the tools + update:

https://community.nxp.com/docs/DOC-332005 

NEW S32 Design Studio for Power v1.1 - Update 1 available 

Stan

0 Kudos

1,171 Views
changchen
Contributor II

thank you very much

0 Kudos

1,171 Views
martin_kovar
NXP Employee
NXP Employee

Hi,

you cannot use this construction:

SIUL2.MSCR0_255[61].B.SSS=0;
SIUL2.MSCR0_255[61].B.ODC=2;

8-bit or 16-bit access to SIUL.MSCR register is prohibited. Only 32-bit access is permitted. You have to use SIUL2.MSCR0_255[61].R = your_value;

Please look at the following figure:

pastedImage_1.png

Regards,

Martin

0 Kudos

1,171 Views
changchen
Contributor II

thank you first of all, I think what you said is  the  main reasons. later I  change the  'SIUL2.MSCR0_255[61].B.SSS=0;
SIUL2.MSCR0_255[61].B.ODC=2; ' into 'SIUL2.MSCR0_255[0].B.SSS=0; SIUL2.MSCR0_255[0].B.ODC=2; ' or  'SIUL2.MSCR0_255[32].B.SSS=0; SIUL2.MSCR0_255[32].B.ODC=2; 'or  'SIUL2.MSCR0_255[145].B.SSS=0; SIUL2.MSCR0_255[145].B.ODC=2; '

the output of corresponding pin is right. 

pastedImage_1.png

0 Kudos