About the autosar_OS sample example configuration GPIO problem

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

About the autosar_OS sample example configuration GPIO problem

1,231件の閲覧回数
lubo_NEW
Contributor III

QQ图片20210302155925.pngQQ图片20210302155925.png

About the autosar_OS sample example configuration GPIO problem
I think it should be 83 pin 84 pin of MPC5748G, which is PD6 and PD7
How to define the pin

 

 

0 件の賞賛
返信
1 返信

1,216件の閲覧回数
namnguyenviet
NXP Employee
NXP Employee

Hello,

There would be no problem with GPIO configuration, as the sample code is based on the EVB board, which can be found here:

https://www.nxp.com/design/development-boards/automotive-development-platforms/mpc57xx-mcu-platforms...

And below description in readme.txt is correct as well:

"Sample for scalability class 1 changes state of GPIO100 pin with
period about 5 sec. GPIO100 is connected to LED3 on EVB for visual indication
of the pin state.
Sample for scalability class 2 changes state of GPIO98 pin in the ProtectionHook
functions. GPIO98 is connected to LED1 on EVB for visual indication
of the pin state.

Sample for scalability class 3 toggles state of GPIO99 pin into ProtectionHook
functions. GPIO99 is connected to LED2 on EVB for visual indication
of the pin state.
Sample for scalability class 4 changes state of GPIO98 pin and GPIO99 pin
into ProtectionHook functions. GPIO98 is connected to LED1,
GPIO99 is connected to LED2 on EVB for visual indication of the pin state."

Anyway, you can redefine whichever the pins you want to toggle the LED. Change the code in sample_hw.h as below:

#define SIUL2_MSCR(n)  SMPL_REG32(GPIO_BASE_ADDR + 0x240 + (n) * 4)  /* SIUL2 Multiplexed Signal Configuration Register */
 
/* GPDO register uses:
 * PDO_4n2: to set/reset LED1
 * PDO_4n3: to set/reset LED2
 * */
#define SIUL2_GPDO(n)  SMPL_REG8(GPIO_BASE_ADDR + 0x1300 + (n))  /* Pad Data Output Register */
 
Then e.g. in sc1, LED3 can be configured to whichever MSCR value corresponding to your expected pin set/clear LED. For example, if you want to choose PTB0 (MSCR=16) as LED indicator, in sample.h:
 
#define LED3    16
 
Best Regards,
Nam
0 件の賞賛
返信