Embedded coder not letting me read and write to GPIO c2000 block

19 次查看(过去 30 天)
This is the error message when I have simulink build the C code:
Error evaluating 'InitFcn' callback of F2837x GPIO Digital Input block (mask) 'smcModel/stateMachine/invFaults/FLT_N_A_H'. Callback string is 'validateC280xGPIO; codertarget.registry.registerC28xPeripheralBlocks(gcb);'
Caused by:
Component:Simulink | Category:Block diagram error
Usage of GPIO block is to write it in one task and read it in another. Coder complains its already in use.
Thank you for your help.

回答(1 个)

Divit
Divit 2024-9-20,17:40
Hi Paul,
I understand that you are encountering an error message while trying to generate code for your Simulink model. The error message indicates that the GPIO Digital Input pin, GPIO77, conflicts with the pin in "GPIO77_FAULT_AH_L."
GPIO77 is already being used by the "GPIO_FAULT_AH_L" block in the path "smcModel/HiTskISR/HiTskSub/enInverter/cgEnInverter/cgEnInverter_SMCV2/GPIO77_FAULT_AH_L."
The init callback function for the GPIO Digital Input block validates the model for the configured GPIO Digital Input pin and will display an error if there is a GPIO conflict with other peripherals.
To resolve this issue, start by finding an unused pin and then reassign the conflicting pin to this available one.
I hope this helps.
  1 个评论
Paul Moore
Paul Moore 2024-9-20,18:23
Divit,
What is the GPIO conflict the callback is detecting?
The processor GPIO may be read and written. That's how it works. I must read and write to this output pin. Coding in 'C' of course works properly. Coding with the C2000 blockset that I purchased is the problem. Does the GPIO block need to be revised?

请先登录,再进行评论。

标签

产品


版本

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by