Use Reset Script File to configure MCU during download

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

Use Reset Script File to configure MCU during download

1,026 Views
jinjingyang
NXP Employee
NXP Employee

Dear Sir,

I'm using S32 Design Studio for NXP MCU S32R372.
For some reason, I need modify some peripherals registers within the 256ms time window after MCU reset.
I modified the reset script file "S32e200_s32r372.mac"
For example, I add the two lines so as to write to register at 0xFFFC0240 and at 0xFFFC1300:
This means set PTA[0] to output high.
mm.l 0xFFFC0240 0x02000000
mm.l 0xFFFC1300 0x01000000


I also modified the cflash algorithm file "Nxp_s32r372_1x32x328k_cflash.pcp".
Add the following two lines: (same meaning as above)
WRITE_LONG=02000000/FFFC0240/
WRITE_LONG=01000000/FFFC1300/

I saved these two files and start the debug/download process in S32DS.
I use an oscilloscope to monitor the RESET signal
I can see PTA[0] output high after RESET signal released to high.
So I think the script modifications work as I expected.

During the S32DS download process, I found that the mac file run twice and pcp file run once.
But there are totally 5 reset pulses observed on oscilloscope.
I attached the waveform figure I captured during the process.
1st reset with mac file, 2nd reset no script, 3rd reset with pcp file, 4th reset no script, 5th reset with mac file.

My questions are:
1) Can I have the manual or guide to show the available commands in mac file and pcp file?
2) Why are there 5 resets occurred during the debug process and 2 resets maybe run no scripts?
3) The delay between RESET release and the write operation to register is too long (more than 200ms).
How can I reduce the delay? I want to have the write operation run immediately after reset.

LeCroy--00000.png

0 Kudos
1 Reply

863 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

sorry for delay. Well, actually I don't have such information. The .pcp and .mac scripts are provided by PE Micro. I found this guide with some basic command description on PE Micro website:  - http://www.pemicro.com/downloads/main_downloads_temp/201807310849476379000/CPROGPPCNEXUS%20User%20Gu... 

Jiri 

0 Kudos