S32K144 with Function to call low level driver

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

S32K144 with Function to call low level driver

1,427 Views
Narudol-T
Contributor III

Dear Sir,

 

Sorry, I posted the topic in wrong forum, but does not know how to delete.

I will repost again from 

https://community.nxp.com/t5/S32K/S32K144-with-Function-to-call-low-level-driver/m-p/1371250#M12782

 

I am trying to trial some basic software of LED drive for calling header file of S32K144.

I have tried follow below thread to implement, then the compilation was success.

However, the LED does not show.

https://community.nxp.com/t5/NXP-Model-Based-Design-Tools/How-to-use-your-own-C-code-in-our-Toolbox-...
The Simulink have 2 blocks for this purpose:

 

1) LED_Initialization : Setting up GPIO direction 

-------------------------------------------------------------------------------------------------------------------

function LED_Initialization

% TODO: Update the bccPath with your project full path
bccPath = coder.const('C:\SVN_Checkout\MATLAB\devkit_S32K144_TICK\src\led');
coder.updateBuildInfo('addSourcePaths', bccPath);

if( coder.target( 'Rtw' ) )
%% Adding header information to the generated code
coder.cinclude('led_peripheries.h');
coder.cinclude('led_mbdt.h');

%% Adding source files to MakeFile
coder.updateBuildInfo( 'addSourceFiles', 'led_peripheries.c' );
coder.updateBuildInfo( 'addSourceFiles', 'led_mbdt.c' );

%% Initializing the BCC driver
coder.ceval('MBD_LED_Initialization');

end

-------------------------------------------------------------------------------------------------------------------

2) LED_On : Write GPIO to be "LOW" for pull-down "RED LED" at PTD15

-------------------------------------------------------------------------------------------------------------------

function LED_On

if( coder.target( 'Rtw' ) )

coder.ceval('MBD_LED_On');

end
end

-------------------------------------------------------------------------------------------------------------------

Can you help advising which parts of code written wrong ?

 

Thanks in advanced

Narudol T.

0 Kudos
2 Replies

1,405 Views
Narudol-T
Contributor III

Thank you for quick reply.

 

But I am working on model-based design. 

I do not sure how to include bootloader into code generation process.

 

can you help advise ?

 

Best Regards,

Narudol T.

 

0 Kudos

1,423 Views
Narudol-T
Contributor III

add more pictures.

0 Kudos