Unable to replicate pwm driver based example in S32DS 3.5 for S32K358 when building from scratch

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

Unable to replicate pwm driver based example in S32DS 3.5 for S32K358 when building from scratch

353 Views
Rnk7
Contributor III

First I begin by configuring the pwm ip example in S32DS to 100KHZ (Emios_Pwm_Ip_S32K358_100KHz), which works perfectly. However, then I attempt to create a new application project (trial_pwm) and replicate this configuration. For some reason, and on multiple checks, I cannot find any difference in these two codes and config files. Both codes can be built, but when I test the outputs on the oscilloscope, trial_pwm has no output. I have attempted to make them completely identical, but there is no pwm generated in this case.

Note: I know I can just copy it to use it, but I want to understand the toolchain and why trial_pwm failing as a consequence.

Tags (3)
0 Kudos
7 Replies

335 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @Rnk7 

The only difference between the example and your project is that you enabled the EMIOS freeze state. The following are the effects when the freeze is enabled:

  • Halts counter, capture, and compare operations.
  • Freezes UC in its current state.
  • Makes all registers accessible.
  • In output modes, force match remains operational, allowing software to force the output to the
    desired level.
  • In input modes, the UC ignores input events.
  • When eMIOS exits Freeze state then UC operations resume, but they may be inconsistent until
    the UC reenters GPIO mode.

B.R

VaneB

0 Kudos

317 Views
Rnk7
Contributor III

Hi @VaneB ,

Ok that does solve things, but also gives me some other problems.

In the attached projects, I again build an extension of this project, a simple single channel and another multi channel adc using BTCU List, with only difference in the no. of channels configured in the list, but the BTCU responds only for single channel. This is when EMIOS freeze state is disabled. Now, if enabled, the PWM is lost yes, but the BTCU responds for both configurations (verified with external PWM). I am unsure of the cause for this, since I dont see any counters involved in parallel BTCU where resources might be split, and wish to inquire if there was any way to resolve such an conflict.

Regards,

Rounak

0 Kudos

313 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @Rnk7 

Check the following post. It is an example that uses the PIT0 trigger to trigger the BCTU conversion list. Five standard ADC channels are selected to be converted. It might be a good reference for your implementation. 

Example S32K344 PIT BTCU ADC DMA

0 Kudos

261 Views
Rnk7
Contributor III

Hi @VaneB ,

I have some problems with the dma here, the dma request path returns me a "Bctu_Ip_Bctu0Fifo1DmaComplete not defined" error. . When I add the RTD/src to the includes paths list for the project, the error goes away, but the BTCU doesn't default to watermark as expected.

I used an updated version of this training example, designed for DS3.5. The example is for RTD3.0.0, I am not sure if any additional configuration is needed for me, since I am using RTD 4.0.0. [https://community.nxp.com/t5/S32K-Knowledge-Base/Example-S32K344-PIT-BTCU-parallel-ADC-FIFO-DMA-DS3-...].

Regards

Rnk7

0 Kudos

202 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @Rnk7 

Could you please clarify what you mean whit "the BTCU doesn't default to watermark as expected"?

0 Kudos

158 Views
Rnk7
Contributor III

The BTCU end of trigger notification, based on the BTCU-DMA Interrupt, has problems. It is the IntCtrl_Ip component which is causing this problem, the interrupt is not functioning when declared there. When I instead manually declare it using Installhandler functions, it works. How do I solve this issue and use IntCtrl_Ip instead?

0 Kudos

152 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @Rnk7 

The interrupt callback Bctu_Ip_Bctu0Fifo1DmaComplete is not managed by the IntCtr_Ip module. This is in charge of the modules Dma_Ip and Btcu_Ip. If you refer to the example you mentioned, the Callback is called in the DMA libraries and uses the Bctu_Ip_FifoDmaHandler in the Btcu_Ip_Irq.

0 Kudos