Wrong dmaController generated code in SDK_S32K1xx_13

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

Wrong dmaController generated code in SDK_S32K1xx_13

1,293 Views
jorgesuarez-riv
Contributor II

Hi All,

I have been updating my developed examples from SDK_S32K14X_11 (S32SDK_S32K14x_BETA_1.9.0) to SDK_S32K1xx_13 (S32SDK_S32K1xx_BETA_2.9.0) and I found out that there might be a possible bug in Processor Expert while generating code for dmaController.

 

DmaController uses edma_channel_config_t structure for configuring each channel.

 

Below you can see both versions SDK_S32K14xx_11 and SDK_S32K1xx_13 (edma_driver.h:287). I have highlighted the issue.

As you can see the generated code (dmaController.c) in SDK_S32K1xx_13 does not include the FEATURE_DMAMUX_AVAILABLE condition to check its compatibility (included in the header edma_driver.h).

It is possible that Processor Expert offer an option to define FEATURE_DMAMUX_AVAILABLE but I have not found it. Sounds to me that the condition should still be in the generated code check for that feature availability, especially if the header file is checking on it too.

Can somebody confirm if this is a known issue?

 

SDK_S32K14xx_11 (edma_driver.h)

 

/*!

* @brief The user configuration structure for the an eDMA driver channel.

*

* Use an instance of this structure with the EDMA_DRV_ChannelInit() function. This allows the user to configure

* settings of the EDMA channel with a single function call.

* Implements : edma_channel_config_t_Class

*/

typedef struct {

#if FEATURE_DMA_CHANNEL_GROUP_COUNT > 0x1U

#ifdef FEATURE_DMA_HWV3

    edma_group_priority_t groupPriority; /*!< eDMA group priority. Used while eDMA

                                              group arbitration is set to fixed priority. */

#endif

#endif

    edma_channel_priority_t channelPriority; /*!< eDMA channel priority - only used when channel

                                                  arbitration mode is 'Fixed priority'. */

    uint8_t virtChnConfig;             /*!< eDMA virtual channel number */

    dma_request_source_t source;       /*!< Selects the source of the DMA request for this channel */

    edma_callback_t callback;          /*!< Callback that will be registered for this channel */

    void * callbackParam;              /*!< Parameter passed to the channel callback */

} edma_channel_config_t;

 

edma_channel_config_t dmaController1Chn0_Config = {

    .channelPriority = EDMA_CHN_DEFAULT_PRIORITY,

    .virtChnConfig = EDMA_CHN0_NUMBER,

    .source = EDMA_REQ_LPUART0_RX,

    .callback = NULL,

    .callbackParam = NULL

};

 

SDK_S32K1xx_13 (edma_driver.h)

 

/*!

* @brief The user configuration structure for the an eDMA driver channel.

*

* Use an instance of this structure with the EDMA_DRV_ChannelInit() function. This allows the user to configure

* settings of the EDMA channel with a single function call.

* Implements : edma_channel_config_t_Class

*/

typedef struct {

#if FEATURE_DMA_CHANNEL_GROUP_COUNT > 0x1U

#ifdef FEATURE_DMA_HWV3

    edma_group_priority_t groupPriority;     /*!< eDMA group priority. Used while eDMA

                                              group arbitration is set to fixed priority. */

#endif

#endif

    edma_channel_priority_t channelPriority; /*!< eDMA channel priority - only used when channel

                                                  arbitration mode is 'Fixed priority'. */

    uint8_t virtChnConfig;                   /*!< eDMA virtual channel number */

#ifdef FEATURE_DMAMUX_AVAILABLE

    dma_request_source_t source;             /*!< Selects the source of the DMA request for this channel */

#endif

    edma_callback_t callback;                /*!< Callback that will be registered for this channel */

    void * callbackParam;                    /*!< Parameter passed to the channel callback */

    bool enableTrigger;                      /*!< Enables the periodic trigger capability for the DMA channel. */

} edma_channel_config_t;

 

 

dmaController.c

 

edma_channel_config_t dmaController1Chn0_Config = {

    .channelPriority = EDMA_CHN_DEFAULT_PRIORITY,

    .virtChnConfig = EDMA_CHN0_NUMBER,

    .source = EDMA_REQ_LPUART0_RX,

    .callback = NULL,

    .callbackParam = NULL,

    .enableTrigger = false

};

0 Kudos
3 Replies

998 Views
jorgesuarez-riv
Contributor II

Hi Rares,

Thanks for the message. Indeed, I was expecting it to be generated depending on the platform. I can see that the macro is defined in the features header file as you mentioned. Despite of updating the repository for the processor, it looks that the new header files are not pulled from the new SDK when porting. Hence the project is using the old platform files. If this is not happening automatically when updating repository it would be nice to have a porting guide for all those necessary changes.

ProcessorExpert.PNG

Thanks,

0 Kudos

998 Views
raresvasile
NXP Employee
NXP Employee

Hi Jorge,

Sorry for the delay.

First, you need to go to Project Properties -> C / C++ Build -> Settings -> C Compiler -> Includes and remove all Preprocessor Include Paths starting with ${S32K146_SDK_<version>_PATH}.

pastedImage_1.png

Second, go to Project Properties -> Processor Expert -> S32 SDK Specific and update SDK path to point to BETA 2.9.0.

pastedImage_2.png

Click OK and then delete the contents of SDK and Generated Code folders.

Now it should work ok. 

PS. Please refer to release notes for changes that are needed in the project to accommodate SDK changes.

Best regards,

Rares

0 Kudos

998 Views
raresvasile
NXP Employee
NXP Employee

Hi,

Thank you for your input.

FEATURE_DMAMUX_AVAILABLE is defined in the device features file(e.g. S32K144_features.h) and it is used to differentiate the feature support based on the platform capabilities.

In the generated code the structure member guarder by the define will be generated only if it is present on that platform. So there is no need for the define to be added in the generated code.

Best regards,

Rares