UART DMA & SPI DMA

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

UART DMA & SPI DMA

824 Views
SuperBeginner
Contributor III

Dear NXP,

I want to develop SPI and UART communication functions using DMA in MBDT, but I can't find any relevant tutorials or examples.

Can you help me?

MBDT S32K312EVB-Q172 #DMA #SPI #UART

 

 

 

0 Kudos
Reply
16 Replies

795 Views
dragostoma
NXP Employee
NXP Employee

Hi, @SuperBeginner,

Currently, the S32K3 Toolbox does not include support for Direct Memory Access (DMA) component. The DMA support will be included in the upcoming MBDT S32K3xx version 1.6.0 release.

Since we provide the complete RTD driver package, you may still implement the DMA functions (which are part of the MCL block) in our toolbox and access the DMA's API using custom code blocks.

Moreover, you have some examples in our toolbox (s32k3xx_isr_custom_code_ebt and s32k344_mc_bldc_ebt) where the application is using custom code. Beside the custom code examples, you should also check the following threads related to custom code usage:

https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/PWM-Capture-for-S32K3-in-Simulink/m-p/1...

https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/SENT-Protocol-Support-in-S32K3-MBDT/m-p...

You can also check the following topic How to use your own C code in our Toolbox (Battery Management System example). Here you will find an additional method of using custom code inside our toolbox.

Until the next version of the toolbox is released, you can use custom code to use the DMA functionality. You will find a thread that can help you related to DMA enabling in MBDT at the following link: https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/DMA-enabling-in-MBDT/m-p/1819674

I hope this helps you for now.

 

Best regards,

Dragos

0 Kudos
Reply

738 Views
SuperBeginner
Contributor III

Hi @dragostoma ,

Thank you for your reply.

I think I still need help.

I referred to the link and configured these in my S32 config tool, but I can't tell if this is correct for the UART DMA configuration.

1. MCU-> MCL General Congiuration -> Enable DMA

1_MCL_EnableDMA.PNG

2. MCU-> MCL Specific Congiuration -> Dma Logic Instance

2_MCL_DMA_Logic_Instance.PNG

3. MCU-> MCL Specific Congiuration -> Dma Logic Channel

3_MCL_DMA_Callback.PNG

4. Uart-> General Congiuration -> Uart DMA Enable

4_UART_DMA_Enabled.PNG

5. Uart-> UartGlobal Config -> Tx DMA channel & Rx DMA channel config

5_UART_DMA_Interrupt.PNG

I know that I can initialize functions in Simulink through Model Header and System Initialize.

However, I don't know how to implement DMA. I think I need a example project.

By the way, I can't find any documentation explaining what each function does.

I don't know what function I should use to achieve what I want.

Could you please provide it?

Thank you.

0 Kudos
Reply

718 Views
dragostoma
NXP Employee
NXP Employee

Hi, @SuperBeginner,

The documentation you need, with explanations of each function and how to use them, can be found at the following path:

toolbox_root/S32K3_RTD/SW32K3_S32M27x_RTD_R21-11_4.0.0_P19/eclipse/plugins/Mcl_TS_T40D34M40I0R0

At this location you can find the following:

- in doc folder you can find RTD_MCL_UM.pdf file, which is the User Manual for the MCL driver;

- in include folder you can find CDD_Mcl.h file, which is the main header file for the MCL driver;

- in src folder you can find CDD_Mcl.c file, which is the main source file for the MCL driver.

Based on the documentation above, you can understand the functionalities of each function, what parameters it has and how to use it in your application using custom code.

Now related to your application, until the next version of the toolbox is released, which will contain example models using DMA, I can guide you with the application you are trying to implement.

1. RM tab

In order to implement a DMA transfer, it will be necessary to add the RM (Resource Manager) component, to be able to set the DMA source.

dragostoma_1-1726644685588.png

dragostoma_0-1726644653570.png

Let's assume that we chose the LPUART 3 instance. We will create a configuration each for TX and RX, to ensure that we set the DMA MUX Source based on the chosen LPUART instance.

dragostoma_2-1726645487993.png

It should be noted that this newly added Rm component must be initialized in the Board initialization.

dragostoma_3-1726645763122.png

dragostoma_4-1726645799467.png

dragostoma_5-1726645831948.png

 

2. MCL tab

The MclDma must be enabled.

dragostoma_6-1726646037213.png

A logic instance must be assigned.

dragostoma_7-1726646096767.png

And the logic channels must be set, for both TX and RX.

dragostoma_8-1726646191963.png

dragostoma_9-1726646262026.png

The Hardware Channel must be the same as the one set in the Rm component, at Dma Hardware Channel (DMA_CHANNEL_16 and DMA_CHANNEL_17). 

For UART using DMA, the interrupt callbacks are already defined based on the LPUART instance, so in this case must be used Lpuart_3_Uart_Ip_DmaTxCompleteCallback and Lpuart_3_Uart_Ip_DmaRxCompleteCallback.

The Enable Global Config check enabled the Global tab usage, where it should be enabled the DMA Request.

dragostoma_10-1726646523326.png

 

3. MCU tab

The corresponding peripheral clocks must be enabled.

dragostoma_12-1726646864226.png

dragostoma_11-1726646802040.png

dragostoma_13-1726646924745.png

dragostoma_15-1726646992733.png

dragostoma_16-1726647019259.png

 

4. PORT tab

The RX and TX pins must be enabled for the LPUART 3 instance.

dragostoma_17-1726647268934.pngdragostoma_18-1726647300601.png

 

5. PLATFORM tab

The corresponding interrupts must be enabled.

dragostoma_19-1726647420028.png

It should be mentioned that the interrupt corresponding to LPUART 3 should not be enabled, because the data transfer will be done through DMA, and the interrupts will be triggered based on the chosen TCDs and RX and TX callbacks.

dragostoma_20-1726647473983.png

 

6. UART tab

The DMA must be enabled.

dragostoma_21-1726647610648.png

You should check also the Uart Timeout Duration according to your application.

dragostoma_22-1726647802791.png

It should be mentioned that for this demonstration we chose LPUART 3 arbitrarily, and that any other instance can be used. Keep in mind that a USB2Serial Converter is needed for this instance, because the RX and TX pins are not directly connected to OpenSDA, as in the case of LPUART 6. If you want to use LPUART 6, the UBS2Serial Converter is no longer needed.

You can use the Simulink model from the Async UART example and it should work correctly for the previously configured LPUART instance. For the Hardware Interrupt Callback part, the model will use the same UART callback that will manage the data transfer through DMA.

Let me know if you managed to configure the UART using DMA.

 

Hope this helps,

Dragos

 

0 Kudos
Reply

712 Views
SuperBeginner
Contributor III

Hi @dragostoma ,

Thank you for your reply.

I have a question during the setting process, which is about the setting of DMA Hardware Channel.

Referring to the picture you provided, you selected ch16 and ch17.

DMA_HardwareChannel_Example.PNG

But I don't see the channel in the s32config tool.

Rm_DMA_Channel.png

I'm worried that this channel setting will be related to the selected uart, but I didn't see the relevant guidance in the user manual.

Do you have any suggestions?

In addition, can you provide me with an example of using this dma setting on simulink?

I have been researching for a long time and still have no clue.

I just need to simply blink the LED when receiving characters.

I'll work on the rest by myself, thank you

 

Tags (1)
0 Kudos
Reply

705 Views
dragostoma
NXP Employee
NXP Employee

Hi, @SuperBeginner,

The reason why the number of channels differs is because in my example I used a different hardware board, namely S32K344. The number of channels differs depending on each hardware board. I chose to use in the presented example an instance and some arbitrarily chosen DMA channels, just for demonstration purposes, but you can choose any instance available on the hardware board you own.

dragostoma_1-1726651962565.png

Dma Hardware Instances are divided so that either Dma Mux Source 0 or Dma Mux Source 1 can be used. In the example shown, Dma Mux Source 1 is used. You can also use the same source, choosing hardware channels from the second half of the list .

The LPUART instances available for each individual source differ and depending on your application and the availability of the LPUART instances, you can choose Dma Mux Source accordingly:

DMA MUX 0: LPUART_0, LPUART_1

dragostoma_3-1726652311267.png

DMA MUX 1: LPUART_2, LPUART_3, LPUART_4, LPUART_5, LPUART_6, LPUART_7

dragostoma_2-1726652188366.png

Whichever instance and channels you choose, make sure you maintain consistency with regards to the DMA configuration.

Based on the information provided, you should be able to configure the UART data transmission functionality using DMA.

 

Best regards,

Dragos

 

0 Kudos
Reply

672 Views
SuperBeginner
Contributor III

Hi @dragostoma ,

I followed your instructions and tried to configure DMA, but was unable to refresh the program.

It always show this error message.

Rm_DMA_ErrorMessage.PNG

Currently, I am using the sample project "s32k3xx_uart_buffer_s32ct" to try to set up the DMA of LPUART 3.

I found that just adding "Rm_tab" in the S32 configuration tool and updating the code caused the error to occur.

Rm_Step.PNG

Although I did not configure anything in Rm_tab and Borad was not initialized when it was initialized, the above error message popped up immediately.

Of course, this also happens if I follow the Borad initialization steps you provided.

Can you give me some advice?

In addition, I want to apologize because English is not my native language. I have some questions about your suggestion

I saw you mentioned "You can use the Simulink model from theAsync UARTexample and it should work correctly for the previously configured LPUART instance. For the Hardware Interrupt Callback part, the model will use the same UART callback that will manage the data transfer through DMA."

Do you mean that I just follow the Example project to complete the block configuration?

For example, enable the uart channel of lpuart 3 in the initialize function.

UART_DMA_InitializeFunction.PNG

Than, change all uart channels to lpuart 3. I can implement DMA.

UART_Example.PNG

Is this your meaning?

Thank you for your reply.

 

 

0 Kudos
Reply

565 Views
dragostoma
NXP Employee
NXP Employee

Hi, @SuperBeginner,

First of all, I would recommend that you initially configure the application using the s32k3xx_uart_async_s32ct model, being simpler, transferring a single character, compared to the model you mentioned s32k3xx_uart_buffer_s32ct, which uses a buffer with which you can transmit several characters.

Secondly, related to the error that mentions that there are two files with the same filename in the list of source files, I recommend you try to delete the files generated next to the model, namely the model_name_Config folder and try to open and build from new model. Also, make sure that you don't have multiple Config folders generated in different locations in the toolbox, because they may interfere with each other. If the error persists during the build, your model and configuration could help us to try to figure out the problem.

Moreover, related to the activation of the RM component, I do not understand exactly how you achieved the enablement of this component, try to follow the described steps and configure in the RM component to be able to use the DMA functionality.

Related to your final question, if you select in the Simulink blocks the UART channel corresponding to the instance that is configured to use DMA, and if you correctly followed all the steps previously described, you should have an application that successfully transmits using DMA. In the Hardware Interrupt Callback block, MBDT_Uart_Callback must be enabled, for this it calls the interrupt callbacks configured for TX and RX.

So, in conclusion, try the previous recommendations and let us know how it works and if you encounter any other problems.

 

Best regards,

Dragos

0 Kudos
Reply

585 Views
SuperBeginner
Contributor III

Dear @dragostoma @Irina_Costachescu,

Can you help me resolve the above error message - "Build process stopped because two files have the same filename in the list of source files" and the above questions about UART DMA in MBDT config?

Thank you

0 Kudos
Reply

554 Views
SuperBeginner
Contributor III

Dear @dragostoma ,

I followed your suggestion and tried configuring again using the example project - "s32k3xx_uart_async_s32ct", but still got the error.

I also tried deleting the file produced by the model after the error occurred, namely "model_name_Config".

I tried my best to screenshot the steps from s32CT configuration to Build & Deploy.

Can you help me check if I'm missing anything that causes this error?

 

 

0 Kudos
Reply

545 Views
dragostoma
NXP Employee
NXP Employee

Hi, @SuperBeginner,

The steps you followed, at first glance, seem correct, with a small exception that I don't know if it's just from the screenshot, but make sure you don't have any spaces in the name of the interrupt handlers, because that's what it looks like from the picture sent.

dragostoma_0-1727102083501.png

The model and its configuration could also help us to test and see if the error is reproduced in our case.

 

Thanks,

Dragos

0 Kudos
Reply

474 Views
SuperBeginner
Contributor III

Dear @dragostoma ,

Regarding the space in the interrupt handler name, this was a misunderstanding caused by my screenshot.

I made sure it has no spaces.

I've attached my model file here to hopefully give you a better idea of ​​my configuration and situation.

Also, I noticed that the full error message is not shown in the screenshot, so I'm attaching it here as well.

 

Thanks

 

 

### Invoking Target Language Compiler on s32k3xx_uart_async_s32ct.rtw
### Using System Target File: C:\Program Files\MATLAB\R2021a\rtw\c\ert\ert.tlc
### Loading TLC function libraries
.......
### Generating TLC interface API for custom data
...
### Initial pass through model to cache user defined code
..
### Caching model source code
........................................................
    ### Writing header file s32k3xx_uart_async_s32ct_types.h
    ### Writing header file s32k3xx_uart_async_s32ct.h
    ### Writing source file s32k3xx_uart_async_s32ct.c
.
    ### Writing header file rtwtypes.h
    ### Writing header file s32k3xx_uart_async_s32ct_private.h
    ### Writing source file s32k3xx_uart_async_s32ct_data.c
    ### Writing header file rtmodel.h
    ### Writing source file ert_main.c
.
### TLC code generation complete.
### Evaluating PostCodeGenCommand specified in the model
### Using toolchain: S32DS GCC
### Build procedure for s32k3xx_uart_async_s32ct aborted due to an error.

Build Summary

Top model targets built:

Model                     Action  Rebuild Reason                                    
====================================================================================
s32k3xx_uart_async_s32ct  Failed  Code generation information file does not exist.  

0 of 1 models built (0 models already up to date)
Build duration: 0h 0m 34.942s
Error using coder.make.internal.getMakeDependencies>locGetModules (line 225)
Build process stopped because two files have the same filename in the list of source files:

 "ert_main.c s32k3xx_uart_async_s32ct.c s32k3xx_uart_async_s32ct_data.c Siul2_Port_Ip_Cfg.c Tspc_Port_Ip_Cfg.c mbdt_board_init.c s32k3_trigger_config.c exceptions.c nvic.c startup.c
 sys_init.c system.c Vector_Table.s startup_cm7.s Adc.c Adc_Ipw.c Adc_Ipw_Irq.c Adc_Sar_Ip.c Adc_Sar_Ip_Irq.c Axbs_Ip.c Bctu_Ip.c Bctu_Ip_Irq.c CDD_Mcl.c CDD_Mcl_Ipw.c CDD_Rm.c
 CDD_Rm_Ipw.c CDD_Uart.c Cache_Ip.c Cache_Ip_HwAcc_ArmCoreMx.c Can_43_FLEXCAN.c Can_43_FLEXCAN_Ipw.c Can_43_FLEXCAN_Irq.c Clock_Ip.c Clock_Ip_Data.c Clock_Ip_Divider.c
 Clock_Ip_DividerTrigger.c Clock_Ip_ExtOsc.c Clock_Ip_FracDiv.c Clock_Ip_Frequency.c Clock_Ip_Gate.c Clock_Ip_IntOsc.c Clock_Ip_Irq.c Clock_Ip_Monitor.c Clock_Ip_Pll.c
 Clock_Ip_ProgFreqSwitch.c Clock_Ip_Selector.c Clock_Ip_Specific.c Cmp_Ip.c DSPSS_Api.c Det.c Det_stub.c Dio.c Dio_Ipw.c Dma_Ip.c Dma_Ip_Driver_State.c Dma_Ip_Hw_Access.c
 Dma_Ip_Irq.c Dma_Ip_Multicore.c Dma_Mux_Ip.c EcuM.c Emios_Gpt_Ip.c Emios_Icu_Ip.c Emios_Icu_Ip_Irq.c Emios_Mcl_Ip.c Emios_Mcl_Ip_Irq.c Emios_Pwm_Ip.c Emios_Pwm_Ip_Irq.c FlexCAN_Ip.c
 FlexCAN_Ip_HwAccess.c FlexCAN_Ip_Irq.c FlexPwm_Ip.c FlexPwm_Ip_Irq.c Flexio_Lin_Ip.c Flexio_Mcl_Ip.c Flexio_Mcl_Ip_HwAccess.c Flexio_Mcl_Ip_Irq.c Flexio_Pwm_Ip.c Flexio_Pwm_Ip_Irq.c
 Flexio_Spi_Ip.c Flexio_Spi_Ip_Irq.c Flexio_Uart_Ip.c Flexio_Uart_Ip_Irq.c Gpt.c Gpt_Ipw.c Icu.c Icu_Ipw.c IntCtrl_Ip.c Lcu_Ip.c Lcu_Ip_Hw_Access.c Lcu_Ip_Irq.c Lcu_Ip_Multicore.c
 Lin_43_LPUART_FLEXIO.c Lin_43_LPUART_FLEXIO_ASRExt.c Lin_43_LPUART_FLEXIO_Ipw.c Lin_Ip_Common.c Lpspi_Ip.c Lpspi_Ip_Irq.c Lpuart_Lin_Ip.c Lpuart_Lin_Ip_Hw_Access.c
 Lpuart_Lin_Ip_Irq.c Lpuart_Uart_Ip.c Lpuart_Uart_Ip_Irq.c Mcu.c Mcu_Dem_Wrapper.c Mcu_Ipw.c Mpu_M7_Ip.c Mscm_Ip.c OsIf_Interrupts.c OsIf_Timer.c OsIf_Timer_System.c
 OsIf_Timer_System_Internal_Systick.c Os_counter_api.c Os_multicore.c Pflash_Ip.c Pit_Ip.c Platform.c Platform_Ipw.c Port.c Port_Ipw.c Power_Ip.c Power_Ip_AEC.c Power_Ip_CortexM7.c
 Power_Ip_DCM_GPR.c Power_Ip_FLASH.c Power_Ip_MC_ME.c Power_Ip_MC_RGM.c Power_Ip_MC_RGM_Irq.c Power_Ip_PMC.c Power_Ip_PMC_Irq.c Power_Ip_Private.c Pwm.c Pwm_Ipw.c Pwm_Ipw_Irq.c
 Ram_Ip.c Rtc_Ip.c SchM_Adc.c SchM_Ae.c SchM_Can.c SchM_CanTrcv_43_AE.c SchM_Can_43_FLEXCAN.c SchM_Crc.c SchM_Crypto.c SchM_Dio.c SchM_Dpga.c SchM_Eep.c SchM_Eth.c
 SchM_EthSwt_43_SJA11XX.c SchM_EthTrcv_43_PHY.c SchM_Eth_43_GMAC.c SchM_Fee.c SchM_Fls.c SchM_Gdu.c SchM_Gpt.c SchM_I2c.c SchM_I2s.c SchM_Icu.c SchM_Ipcf.c SchM_Iseled.c
 SchM_Lin_43_LPUART_FLEXIO.c SchM_Mc12xs6.c SchM_Mcl.c SchM_Mcu.c SchM_MemAcc.c SchM_Mem_43_Eep.c SchM_Mem_43_ExFls.c SchM_Mem_43_InFls.c SchM_Ocotp.c SchM_Ocu.c SchM_Platform.c
 SchM_Port.c SchM_Pwm.c SchM_Rm.c SchM_Sbc_fs26.c SchM_Sent.c SchM_Spi.c SchM_Uart.c SchM_Wdg.c SchM_Wdg_43_fs26.c SchM_Zipwire.c Sdadc_Ip.c Sdadc_Ip_Irq.c Sema42_Ip.c Siul2_Dio_Ip.c
 Siul2_Icu_Ip.c Siul2_Icu_Ip_Irq.c Siul2_Port_Ip.c Spi.c Spi_Ipw.c Stm_Ip.c System_Ip.c Trgmux_Ip.c Trgmux_Ip_HwAcc.c Tspc_Port_Ip.c Uart_Ipw.c Virt_Wrapper_Ip.c Wkpu_Ip.c
 Wkpu_Ip_Irq.c Xbic_Ip.c Xrdc_Ip.c Adc_Cfg.c Adc_Ipw_MBDT_PBcfg.c Adc_MBDT_PBcfg.c Adc_Sar_Ip_MBDT_PBcfg.c Axbs_Ip_MBDT_PBcfg.c Bctu_Ip_MBDT_PBcfg.c CDD_Mcl_Cfg.c
 CDD_Mcl_MBDT_PBcfg.c CDD_Rm_Cfg.c CDD_Rm_Ipw_MBDT_PBcfg.c CDD_Rm_MBDT_PBcfg.c CDD_Uart_MBDT_PBcfg.c CanIf_Cfg.c CanIf_MBDT_PBcfg.c Can_43_FLEXCAN_Ipw_MBDT_PBcfg.c
 Can_43_FLEXCAN_MBDT_PBcfg.c Clock_Ip_Cfg.c Clock_Ip_MBDT_PBcfg.c Cmp_Ip_MBDT_PBcfg.c Dio_Cfg.c Dma_Ip_Cfg.c Dma_Ip_MBDT_PBcfg.c Dma_Mux_Ip_MBDT_PBcfg.c Emios_Gpt_Ip_MBDT_PBcfg.c
 Emios_Icu_Ip_MBDT_PBcfg.c Emios_Mcl_Ip_MBDT_PBcfg.c Emios_Pwm_Ip_MBDT_PBcfg.c FlexCAN_Ip_MBDT_PBcfg.c FlexPwm_Ip_MBDT_PBcfg.c Flexio_Lin_Ip_MBDT_PBcfg.c Flexio_Mcl_Ip_MBDT_PBcfg.c
 Flexio_Pwm_Ip_MBDT_PBcfg.c Flexio_Spi_Ip_MBDT_PBcfg.c Flexio_Uart_Ip_MBDT_PBcfg.c Gpt_Cfg.c Gpt_Ipw_MBDT_PBcfg.c Gpt_MBDT_PBcfg.c Icu_Cfg.c Icu_DmaNotification.c
 Icu_Ipw_MBDT_PBcfg.c Icu_MBDT_PBcfg.c Igf_Port_Ip_MBDT_PBcfg.c IntCtrl_Ip_Cfg.c Lcu_Ip_Cfg.c Lcu_Ip_MBDT_PBcfg.c Lin_43_LPUART_FLEXIO_Cfg.c Lin_43_LPUART_FLEXIO_Ipw_MBDT_PBcfg.c
 Lin_43_LPUART_FLEXIO_MBDT_PBcfg.c Lpspi_Ip_MBDT_PBcfg.c Lpuart_Lin_Ip_MBDT_PBcfg.c Lpuart_Uart_Ip_MBDT_PBcfg.c Mcu_Cfg.c Mcu_MBDT_PBcfg.c Mpu_M7_Ip_Cfg.c Mscm_Ip_MBDT_PBcfg.c
 OsIf_Cfg.c Pflash_Ip_Cfg.c Pflash_Ip_MBDT_PBcfg.c Pit_Ip_MBDT_PBcfg.c Platform_Cfg.c Platform_Ipw_Cfg.c Port_Cfg.c Port_MBDT_PBcfg.c Power_Ip_Cfg.c Power_Ip_MBDT_PBcfg.c
 Pwm_MBDT_PBcfg.c Ram_Ip_Cfg.c Ram_Ip_MBDT_PBcfg.c Rtc_Ip_MBDT_PBcfg.c Sdadc_Ip_MBDT_PBcfg.c Siul2_Icu_Ip_MBDT_PBcfg.c Siul2_Port_Ip_Cfg.c Siul2_Port_Ip_MBDT_PBcfg.c
 Spi_Ipw_MBDT_PBcfg.c Spi_MBDT_PBcfg.c Stm_Ip_MBDT_PBcfg.c Trgmux_Ip_Cfg.c Trgmux_Ip_MBDT_PBcfg.c Tspc_Port_Ip_Cfg.c Tspc_Port_Ip_MBDT_PBcfg.c Uart_Ipw_MBDT_PBcfg.c
 Virt_Wrapper_Ip_MBDT_PBcfg.c Wkpu_Ip_MBDT_PBcfg.c Xbic_Ip_MBDT_PBcfg.c Xrdc_Ip_Cfg.c Xrdc_Ip_MBDT_PBcfg.c"

Error in coder.make.internal.getMakeDependencies (line 31)
    srcDeps = locGetModules(lBuildInfo,ext,incGrps,excGrps);

Error in coder.make.Builder.getDependencyInfo (line 18)
[dependencyTree, sysLibsPaths] = coder.make.internal.getMakeDependencies...

Error in coder.make.Builder (line 114)
            [h.DependencyTree, h.SysLibPaths] = coder.make.Builder.getDependencyInfo...

Error in coder.make.invokeBuilder (line 24)
builder = feval(builderName, buildInfo, lBuildConfiguration, ...

Error in RTW.genMakefileAndBuild (line 441)
        coder.make.invokeBuilder...

Error in codebuild (line 213)
    lMakeResult = RTW.genMakefileAndBuild...

Error in coder.internal.ModelBuilder/buildProcedure (line 1513)
                    compileResult = codebuild(lBuildInfoUpdated, compileBuildOptsUpdated);

Error in coder.internal.ModelBuilder/make_rtw (line 168)
                [buildResult, mainObjFolder] = buildProcedure...

Error in coder.internal.ModelCodegenMgr/make_rtw (line 8)
    [buildResult, mainObjFolder] = obj.make_rtw(varargin);

Error in make_rtw (line 20)
[buildResult, mainObjFolder] = h.make_rtw(buildArgs, varargin{:});

Error in build_target

Error in build_target

Error in build_standalone_rtw_target

Error in slbuild_private

Error in slbuild_private

Error in sl

Error in slbuild

Error in rtwbuild

 

 

0 Kudos
Reply

439 Views
dragostoma
NXP Employee
NXP Employee

Hi, @SuperBeginner,

I downloaded your archive and tried to open the model. First of all, I notice that you mention that you are using toolbox version 1.5.0 which uses RTD version 4.0.0 P19. When I try to open the model, the model migration pop-up appears, notifying me that the version of RTD has changed from 3.0.0 (corresponding to toolbox version 1.4.0) to 4.0.0 (corresponding to the latest version of toolbox, 1.5.0).

dragostoma_0-1727159213953.png

This indicates that there is a problem somewhere and you are actually using an earlier version of the toolbox. As I mentioned before, various problems can arise from here if the toolbox versions interfere with each other.

The same thing can be seen from the settings you are trying to configure in Hardware Settings, which denotes the use of a previous toolbox version (1.4.0

- your settings:

dragostoma_1-1727159393708.png

- the 1.5.0 toolbox settings:

dragostoma_2-1727159458384.png

 

- your settings:

dragostoma_3-1727159560412.png

- the 1.5.0 toolbox settings:

dragostoma_4-1727159619748.png

 

- your settings:

dragostoma_5-1727159650146.png

- the 1.5.0 toolbox settings:

dragostoma_7-1727160157131.png

 

So, the general idea and the conclusion we can draw is that you are actually using an older version of the toolbox, which can cause the problems you encounter. Or if that's what you want, to use version 1.4.0, that's what you have to mention, just like the version of MATLAB you're using and that caused us problems in previous threads. It is important to mention because the workflows differ according to each version. The steps I presented are for the latest version of toolbox, 1.5.0.

Let us know about the progress made.

 

Best regards,

Dragos

0 Kudos
Reply

413 Views
SuperBeginner
Contributor III

Dear @dragostoma ,

I made sure to correct my Matlab environment to R2021a and MBDT version is 1.4.0 now.

I recently changed my computer and currently unable to install any files from external websites, so I didn't update the MBDT version to 1.5.0.

I'm very sorry. I didn't tell you clearly which version of the toolbox I'm using.

I didn't know it had that effect on DMA config.

If possible, can I configure DMA using mbdt 1.4.0?

Because I should not be possible to install the MBDT 1.5.0 in a short period of time.

Also, I thought the major version difference between 1.5.0 and 1.4.0 is the different block functions available on simulink.

Could you describe why there is such an error due to different versions, please?

 

Thank you

0 Kudos
Reply

368 Views
dragostoma
NXP Employee
NXP Employee

Hi, @SuperBeginner,

Each version of the toolbox has its own peculiarities, with possible major changes to the workflow or configuration of the settings. A new toolbox version not only means different functions in Simulink blocks, but different versions of tools, such as S32 Configuration Tools, which can change the way some settings are configured. For example, a major difference between toolbox versions 1.4.0 and 1.5.0 is the way the pins are configured in the S32 Configuration Tools. I recommend this thread to understand the peculiarities and differences compared to version 1.4.0 that you are currently using.

In the steps I detailed for you regarding the DMA configuration, I used the latest version, i.e. 1.5.0, where the Port component is used. In the previous version, 1.4.0, the approach was different, the pins were configured directly in the Pins tool, the Port component was not needed, but the Siul2_Port component was needed instead. The fact that you also enabled the Port component led to the problems you encountered when trying to configure your application.

I recommend that in the future you specify more exactly which versions you are trying to use, because this way we will get to solving the problems much faster.

I leave attached the version of your model that can be built, with the changes mentioned above, that is, the deletion of the Port component and its initialization from the board init.

I hope that now you can successfully configure your application.

 

Best regards,

Dragos

0 Kudos
Reply

353 Views
SuperBeginner
Contributor III

Dear @dragostoma ,

Thanks for explaining the version differences between MBDT 1.4 and 1.5.0.

I will definitely explain my environment in detail in the future.

 

In addition, regarding DMA configuration issues, I can't open the model you provided.

It always shows this error message.

Error Message.PNG

However, I followed your instructions to configure the S32 Config Tool, that is, the deletion of the Port component and its initialization from the board init.

I can successfully building the program to s32k312evb-q172.

Than, I used the USB2Seraial Converter and connected it to the TX and RX pins on the board.

That is, USB_Converter_TX is connected to PTE15 PIN (J3.21), USB_Converter_RX is connected to PTE15 PIN (J3.18), USB_Converter_GND is connected to GND (J39.19).

After establishing these connections, I communicated using the serial communication tool (for example PuTTY), but the UART communication failed.

No characters from LPUART 3 will appear in my monitor window.

I've attached my program here, could you figure out the problem, please?

 

Thanks in advance

0 Kudos
Reply

185 Views
SuperBeginner
Contributor III

Dear @dragostoma ,

Do you have any suggestions for solutions regarding UART DMA configuration?

Could you help me, please?

Thanks

0 Kudos
Reply