S32 DS 3.4 Clock Config

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

S32 DS 3.4 Clock Config

Jump to solution
3,027 Views
partis
Contributor III

Hi

Using the clock tree designer in S32 DS 3.4 is great. It allows very quick changes; but it doesn't generate the resultant code correctly. For example, FlexCAN0 clock comes from the system clock (SYS_CLK @ 48MHz), and the comment in the generated clock_config.c correctly reads:

- {id: FLEXCAN0_CLK.outFreq, value: 48 MHz}

However, further down the same generated file, it says:

{
.clockName = FlexCAN0_CLK,
.clkGate = true,
.clksrc=CLK_SRC_OFF,
.frac = MULTIPLY_BY_ONE,
.divider = DIVIDE_BY_ONE,
},

ie, no clock source (CLK_SRC_OFF).

Is this a known problem? 

Kind regards

Gary Partis

 

Gary Partis
0 Kudos
Reply
1 Solution
2,879 Views
partis
Contributor III

Hi Mike

I have now got to the bottom of this

The reason for failed CAN comms/IRQs/etc is due to the bit time setup within the CAN peripheral module. It was set to 2+Mbaud on a non-CANFD configuration which caused the module not to work (no IRQs for completion, errors, etc). Setting the baudrate to 250Kbaud allowed it all to work correctly.

The FlexCAN0 clock source in the generated code was a red herring:

{
    .clockName = FlexCAN0_CLK,
    .clkGate = true,
    .clkSrc = CLK_SRC_OFF,
    .frac = MULTIPLY_BY_ONE,
    .divider = DIVIDE_BY_ONE,
},

I'll mark this thread as closed

Kind regards

Gary Partis

View solution in original post

6 Replies
2,995 Views
mikedoidge
NXP Employee
NXP Employee

Hi Gary,

I see you have the following package installed:

Package: S32SDK S32K1XX RTM 4.0.2; Version: 4.0.2; Build id: 202106110620

But you do not have this package installed:

Package: RTD S32K1 1.0.0; Version: 1.0.0; Build id: 202108251230

This means you are using the S32 SDK for S32K1xx, which is no longer actively supported by new development, bug fixes, etc.

The S32 SDK has been replaced by the Real-Time Drivers (RTD) | NXP Semiconductors . Some of the significant differences are:

  • RTD has both AUTOSAR and NON-AUTOSAR drivers, S32 SDK only has NON-AUTOSAR drivers
  • RTD supports the newer NXP GCC 9.2, S32 SDK supports the NXP GCC 6.3

If the issue you reported is a bug, I'm not sure if it would be fixed.

If you are tied to the S32 SDK for your development (due to legacy code, etc.), then I would need to report this issue to the support team for the S32 SDK and RTD. This team is also available at:  S32 SDK - NXP Community

If you would like to install and use the RTD instead, which I would highly encourage you to do, it is available from within the S32DS Extensions and Updates menu, look for this package (for you it would not show Installed

mikedoidge_0-1654640140875.png

Please let me know how you wish to proceed.

Best Regards,

Mike

 

0 Kudos
Reply
2,880 Views
partis
Contributor III

Hi Mike

I have now got to the bottom of this

The reason for failed CAN comms/IRQs/etc is due to the bit time setup within the CAN peripheral module. It was set to 2+Mbaud on a non-CANFD configuration which caused the module not to work (no IRQs for completion, errors, etc). Setting the baudrate to 250Kbaud allowed it all to work correctly.

The FlexCAN0 clock source in the generated code was a red herring:

{
    .clockName = FlexCAN0_CLK,
    .clkGate = true,
    .clkSrc = CLK_SRC_OFF,
    .frac = MULTIPLY_BY_ONE,
    .divider = DIVIDE_BY_ONE,
},

I'll mark this thread as closed

Kind regards

Gary Partis
2,962 Views
partis
Contributor III

Hi Mike

Many thanks for your reply. Rejigging the mcu_data in the .mex file allows use of the different package.

But, whilst the RTD package picks up our existing pin allocation, and part of the clock tree configuration; the drivers have completely different APIs, and more concerningly, no FreeRTOS which was required in this project.

Could I be missing something obvious...?

Kind regards

 

Gary Partis
0 Kudos
Reply
2,954 Views
mikedoidge
NXP Employee
NXP Employee

Hi Gary,

I think you may be right. 

@cuongnguyenvan , could you please confirm if there is a FreeRTOS package available for RTD users on S32K1xx platforms?

Best Regards,

Mike

0 Kudos
Reply
3,016 Views
mikedoidge
NXP Employee
NXP Employee

Hi Gary,

Would you kindly share the installation details so we could know what version is impacted by this issue?

Help -> S32DS Extensions and Updates, then click on 'Installation Details' at the lower right of the Overview panel.

If the device you are using is part of a family, please specify the exact processor name.

Thanks,

Mike

0 Kudos
Reply
3,010 Views
partis
Contributor III

Hi Mike

We are targeting an S32K144 LQFP64 device. The installation details of the IDE and extra is thus:

Package: GDB Client for ARM Embedded Processors 9.2 Build 1701; Version: 1701; Build id: 202012011653
Package: S32 Design Studio Platform package; Version: 3.4.3; Build id: 202112151555
Package: S32K1xx development package; Version: 3.4.1; Build id: 202106101451
Package: NXP GCC for Arm Embedded Processors v6.3 build 2017 with EWL2; Version: 2017; Build id: 202005201521
Package: NXP GCC for Arm Embedded Processors v9.2 build 1649; Version: 1649; Build id: 202005201157
Package: GNU ARM PEMicro Interface Debugging Support; Version: 5.2.0; Build id: 202203211842
Package: AMMCLIB for S32K14x devices; Version: 1.1.27; Build id: 202112140821
Package: S32 Design Studio Platform Tools package; Version: 3.4.3; Build id: 202112151555
Package: S32SDK S32K1XX RTM 4.0.2; Version: 4.0.2; Build id: 202106110620
Package: NXP GCC for Arm Embedded Processors Build 1620; Version: 1620; Build id: 202005201521

Would a copy of the .mex file help find this issue?

Kind regards

Gary

 

Gary Partis
0 Kudos
Reply