Multi Source Translation Content

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

Multi Source Translation Content

Discussions

Sort by:
Setting UP CAN bus on S32K358 using MBDT Hello, I am currently working on the CAN bus communication using S32k358. There are no examples for k358 chip, so based on the CAN transmit s32ct example, I made one for k358. However, when i deploy the example and connected my can analyzer, I am not reading anything and i do not observe the can_msg variable to increment (incrementing should've mean successful sent). It did not show any compilation error so i assumed it to be something hardware wrong. Then i look into the datasheet and found that there exists a SPI communication between the can trans_reciever and MCU.  So the question is, do i have to manually wakeup the can trans_reciever using SPI to send and recieve CAN message? Or am I doing anything wrong with the CAN setup. Thanks Re: Setting UP CAN bus on S32K358 using MBDT It helped a lot, thank you very much for the help! Re: Setting UP CAN bus on S32K358 using MBDT Hello @primo  First of all, from the schematic screenshot you have attached, I understand that you are using the RD-K358BMU Reference Design kit. This would have been really valuable information for us to support your request. For this particular board, we do offer a ready-to-run example that has the VCU CAN already configured and performing the task you are aiming for. This example is called k358bmu_read_s32ct and can be accessed from the MBDT for BMS 1.1.0. Please make sure you have the latest MBDT for BMS 1.1.0 installed! Once you do that, go in the MATLAB command window and type the following command to access the example in the Current Folder. >> cd(fullfile(mbd_find_bms_root, 'BMS_Examples\k358bmu\k358bmu_read_s32ct')) To give a bit of context, you are right, the CAN transceiver needs to be initialized before messages are sent over the CAN bus. The TJA initialization sequence is performed in the Initialize Function under VCU_CAN_INIT subsystem. And of course, the Spi channel needs to be properly set to match the SPI requirements of the TJA CAN transceiver. But this is already performed using the external configuration tools, by the channel name SpiChannel_TJA. Hope this helps, Marius
View full article
Regarding the question of S32K312 using JLink for online debugging Hi NXP TechSupport, Use the routine engineering that comes with the software, use JLink to connect to online debugging, and the relevant settings for debugging are as shown in the following figure. When loaded into the debugging window, the debugging process is not entered correctly. Debugging | Flash Programming Eclipse IDE Usage and Settings Re: Regarding the question of S32K312 using JLink for online debugging Hi @Julián_AragónM , The problem that J-Link cannot be debugged properly in SWD mode is due to the Debug configuration settings.In the Debug configuration, the Enable SWO option in the Startup page is selected, and other settings are not set, which affects the debugging and prevents normal debugging. Tick off the options in the following diagram to get back to normal. Thank you for your technical support. Best regards, Jason Re: Regarding the question of S32K312 using JLink for online debugging Hi @Jason_L, Please check the optimization inside the project's properties is set to 0: Best regards, Julián Re: Regarding the question of S32K312 using JLink for online debugging Hi @Julián_AragónM , Thank you for your reply. Regarding your question, sorry I couldn't find PE Micro to confirm if there was a problem with the project. Regarding the project I created, this project is a sample project and I haven't tried to modify it. As you said, I tried to use J-Flash to connect and download binary, and everything worked fine. The operation is as follows: Application log started - J-Flash V7.96h (J-Flash compiled May 15 2024 15:37:47) - JLinkARM.dll V7.96h (DLL compiled May 15 2024 15:37:22) Reading flash device list [D:\NXP\S32DS.3.5\Drivers\SEGGER\JLink_V796h\ETC/JFlash/Flash.csv] ... - List of flash devices read successfully (451 Devices) Reading MCU device list ... - List of MCU devices read successfully (10955 Devices) Creating new project ... - New project created successfully Connecting ... - Connecting via USB to probe/ programmer device 0 - Probe/ Programmer firmware: J-Link V9 compiled May 7 2021 16:26:12 - Probe/ Programmer S/N: 69408534 - Device "S32K312" selected. - Target interface speed: 4000 kHz (Fixed) - VTarget = 3.309V - ConfigTargetSettings() start - ConfigTargetSettings() end - Took 13us - InitTarget() start - SDA_AP detected - Checking if debug access is already enabled... - Core already enabled - Checking if HSE firmware is installed... - HSE firmware not installed - Checking if Cortex-M7_0 and Cortex-M7_1 are operating in lockstep mode - Lock step mode disabled or not available - InitTarget() end - Took 8.10ms - Found SW-DP with ID 0x6BA02477 - DPIDR: 0x6BA02477 - CoreSight SoC-400 or earlier - AP map detection skipped. Manually configured AP map found. - AP[0]: MEM-AP (IDR: Not set) - AP[1]: APB-AP (IDR: Not set) - AP[2]: MEM-AP (IDR: Not set) - AP[3]: AHB-AP (IDR: Not set) - AP[4]: AHB-AP (IDR: Not set) - AP[5]: AHB-AP (IDR: Not set) - AP[6]: MEM-AP (IDR: Not set) - AP[7]: MEM-AP (IDR: Not set) - AP[4]: Skipped ROMBASE read. CoreBaseAddr manually set by user - AP[4]: Core found - CPUID register: 0x411FC272. Implementer code: 0x41 (ARM) - Cache: L1 I/D-cache present - Found Cortex-M7 r1p2, Little endian. - FPUnit: 8 code (BP) slots and 0 literal slots - ROM table scan skipped. CoreBaseAddr manually set by user: 0x40250400 - I-Cache L1: 8 KB, 128 Sets, 32 Bytes/Line, 2-Way - D-Cache L1: 8 KB, 64 Sets, 32 Bytes/Line, 4-Way - SetupTarget() start - ECC RAM init skipped. - SetupTarget() end - Took 2us - Executing init sequence ... - Initialized successfully - Target interface speed: 4000 kHz (Fixed) - Found 1 JTAG device. Core ID: 0x6BA02477 (None) - Connected successfully Opening data file [C:\Users\win11\workspaceS32DS.3.5\I2c_IP_FLEXIO_Transfer_S32K312\Debug_FLASH\I2c_IP_FLEXIO_Transfer_S32K312.bin] ... - Data file opened successfully (38948 bytes, 1 range, CRC of data = 0x07C4B116, CRC of file = 0x07C4B116) Auto programming target (38948 bytes, 1 range) ... - Checking if selected data fits into selected flash sectors. - Start of preparing flash programming - End of preparing flash programming - Start of determining dirty areas in flash cache - End of determining dirty areas - CPU speed could not be measured. - Start of erasing sectors - Blank checking 0x00400000 - 0x00409FFF - Erasing range 0x00400000 - 0x00409FFF ( 5 Sectors, 40 KB) - End of erasing sectors - Start of flash programming - Programming range 0x00400000 - 0x00407FFF ( 4 Sectors, 32 KB) - Programming range 0x00408000 - 0x00409FFF ( 1 Sector, 8 KB) - End of flash programming - Flash programming performed for 1 range (40960 bytes) - 0x400000 - 0x409FFF ( 5 Sectors, 40 KB) - Start of verifying flash - End of verifying flash - Start of restoring - End of restoring - Executing exit sequence ... - De-initialized successfully - Target erased, programmed and verified successfully - Completed after 0.363 sec The debug mode outputs the result. Best regards, Jason Re: Regarding the question of S32K312 using JLink for online debugging Hi @Jason_L, Could you confirm you can debug correctly this project with PE Micro? Just so we can rule out if the project is faulty. You can also try using J-Flash to see if the debugger is the issue or not. You should be able to select a new project and configure the S32K312 as target device, then just trying to erase the MCU or program a binary: I can successfully debug the S32K344EVB with a J-Link debugger. The only difference I can spot is the executable directory for both J-Link GDB and GDB Client Setup (but if you are able to go into debug view this is probably not the issue). Best regards, Julián
View full article
S32K312-Accessing C40_Ip_MainInterfaceWriteStatus causes program error Hello When I was writing a Flash test, I called the function C40_Ip_MainInterfaceWriteStatus without executing the write operation, causing the program to freeze. After investigation, I found that it was stuck in the C40_IP_DEV_ASSERT(Length > 0UL); statement in the function C40_Ip_Compare. Where is the function C40_Ip_MainInterfaceWriteStatus? Can it be called only under certain circumstances? Has writing data been successfully executed at least once? BestRegards Simon Re: S32K312-Accessing C40_Ip_MainInterfaceWriteStatus causes program error Hi Daniel I understand. You must call the C40_Ip_MainInterfaceWrite() interface and assign values to these variables before calling the C40_Ip_MainInterfaceWriteStatus function. Thank you for your reply. BestRegards Simon Re: S32K312-Accessing C40_Ip_MainInterfaceWriteStatus causes program error Hi Simon, The driver stores these variables from the last C40_Ip_MainInterfaceWrite() call. And if the veriification / development errors are enabled, the behavior is expected. Regards, Daniel Re: S32K312-Accessing C40_Ip_MainInterfaceWriteStatus causes program error Hello @danielmartynek  The RTD driver version I use is S32K3_RTD_3_0_0_D2303_ASR_REL_4_7_REV_0000_20230331. BestRegards Simon Re: S32K312-Accessing C40_Ip_MainInterfaceWriteStatus causes program error Hello Simon, What revision of the RTD drivers do you use? Thanks, Daniel
View full article
need help making USB OTG Audio and Power Delivery (PD) work properly I need help making USB OTG Audio and Power Delivery (PD) work properly when connected to either a phone or a computer. I’ve already implemented USB OTG Audio, and it works fine on its own. However, I’m not sure how to integrate PD with OTG Audio. The implementation seems quite complex, and it might be difficult to explain fully within this forum format. Could you provide any advice or resources to help me tackle this issue? Re: need help making USB OTG Audio and Power Delivery (PD) work properly Hi @5angxr, This document does not mention how to integrate that specific use case, but it is the closest we have to your PD application. BR, Edwin. Re: need help making USB OTG Audio and Power Delivery (PD) work properly thanks for your reply, and sorry for my late response. Do "USB Type-C PD Stack Reference Manual" and "USB Type-C Power Delivery Stack User Guide" tell users how to integrate PD with OTG Audiom? Re: need help making USB OTG Audio and Power Delivery (PD) work properly On the RT1040 SDK, you will find the "USB Type-C PD Stack Reference Manual" and "USB Type-C Power Delivery Stack User Guide", which explain in detail everything relating PD for the RT1040. You can find these documents on the following path: SDK_2_16_000_MIMXRT1040-EVK.zip\middleware\usb\docs BR, Edwin. Re: need help making USB OTG Audio and Power Delivery (PD) work properly rt1042 Re: need help making USB OTG Audio and Power Delivery (PD) work properly Hi @5angxr, What device are you trying to implement this into? What P/N are you using? BR, Edwin.
View full article
SAI_TxSetBitClockRate参数问题 我正在尝试设置 SAI(仅发送,作为主服务器)。 但我对 SAI_TxSetBitClockRate 参数感到困惑,记录如下: /*! * brief Transmitter bit clock rate configurations. * * param base SAI base pointer. * param sourceClockHz, bit clock source frequency. * param sampleRate audio data sample rate. * param bitWidth, audio data bitWidth. * param channelNumbers, audio channel numbers. */ void SAI_TxSetBitClockRate( I2S_Type *base, uint32_t sourceClockHz, uint32_t sampleRate, uint32_t bitWidth, uint32_t channelNumbers) 1)什么是uint32_t channelNumbers? 在代码中,这似乎被用作通道数(即立体声为 2): uint32_t bitClockFreq = sampleRate * bitWidth * channelNumbers; 2)uint32_t sourceClockHz是什么? 这仅仅是模块的时钟输入吗?由时钟工具生成,即 #define BOARD_BOOTCLOCKRUN_SAI1_CLK_ROOT 63529411UL 提前致谢, 谨致问候,戴夫
View full article
s32k312 でフラッシュが消去されるとC40_Ip_MainInterfaceHVJobStatus API のハード フォールト NXPチームの皆さん、こんにちは。 ハードフォルト(1.jpg)S32K312のセクタ(0x00400000)消去機能を確認しているときに問題が発生します。 以下のAPI関数はSRAM(".ramcode")に配置する必要がありますセクション) を添付ファイル (2.jpg) として追加します。 C40_Ip_MainInterfaceSectorErase C40_Ip_MainInterfaceSectorEraseStatus C40_Ip_MainInterfaceWrite C40_Ip_MainInterfaceWriteStatus この問題を解決するために、教えていただけますか?
View full article
SAI_TxSetBitClockRateパラメータに関する質問 SAI(送信専用、マスターとして)を設定しようとしています。 しかし、私は次のように文書化されたSAI_TxSetBitClockRateパラメータに混乱しています。 /*! * brief Transmitter bit clock rate configurations. * * param base SAI base pointer. * param sourceClockHz, bit clock source frequency. * param sampleRate audio data sample rate. * param bitWidth, audio data bitWidth. * param channelNumbers, audio channel numbers. */ void SAI_TxSetBitClockRate( I2S_Type *base, uint32_t sourceClockHz, uint32_t sampleRate, uint32_t bitWidth, uint32_t channelNumbers) 1) uint32_t channelNumbersとは何ですか? コードでは、これはnumberOfChannels(つまりステレオの場合は2)として使用されているようです。 uint32_t bitClockFreq = sampleRate * bitWidth * channelNumbers; 2) sourceClockHz uint32_tとは何ですか? これは、クロックツールによって生成されたモジュールのクロック入力だけですか? #define BOARD_BOOTCLOCKRUN_SAI1_CLK_ROOT 63529411UL よろしくお願いします。 よろしくお願いします、デイブ
View full article
USB OTGオーディオおよび電力供給(PD)を適切に機能させるためのサポートが必要です USB OTG Audio and Power Delivery(PD)を電話またはコンピュータに接続したときに正しく動作させるためのサポートが必要です。 私はすでにUSB OTGオーディオを実装していますが、それ自体で問題なく動作します。ただし、PDをOTGオーディオと統合する方法がわかりません。実装は非常に複雑に思え、このフォーラム形式で完全に説明するのは難しいかもしれません。 この問題に取り組むためのアドバイスやリソースを提供していただけますか? Re:USB OTGオーディオと電力供給(PD)を適切に機能させるための支援が必要です お返事ありがとうございます、そして私の遅れた返信で申し訳ありません。「USB Type-C PDスタックリファレンスマニュアル」および「USB Type-C Power Deliveryスタックユーザーガイド」は、PDとOTG Audiomの統合方法をユーザーに説明していますか? Re:USB OTGオーディオと電力供給(PD)を適切に機能させるための支援が必要です RT1042の
View full article
需要帮助使 USB OTG 音频和电源传输(PD)正常工作 我需要帮助,使 USB OTG 音频和电源传输 (PD) 在连接到手机或计算机时正常工作。 我已经实现了 USB OTG 音频,它本身运行良好。但是,我不确定如何将 PD 与 OTG 音频集成。实施起来似乎相当复杂,可能很难在这种论坛形式内完全解释。 您能提供任何建议或资源来帮助我解决这个问题吗? 回复:需要帮助使 USB OTG 音频和电源传输(PD)正常工作 感谢您的回复,抱歉我回复晚了。《USB Type-C PD 堆栈参考手册》和《USB Type-C 电源传输堆栈用户指南》是否告诉用户如何将 PD 与 OTG Audiom 集成? 回复:需要帮助使 USB OTG 音频和电源传输(PD)正常工作 rt1042
View full article
Hard Fault in C40_Ip_MainInterfaceHVJobStatus api when flash is erase in s32k312 Hi NXP team. The HardFault(1.jpg) issue happens while checking sector(0x00400000) erase functionality of S32K312. The below API functions have to be placed into SRAM (".ramcode" section), as the attached files(2.jpg). C40_Ip_MainInterfaceSectorErase C40_Ip_MainInterfaceSectorEraseStatus C40_Ip_MainInterfaceWrite C40_Ip_MainInterfaceWriteStatus                                                                                                         Could you please let me know to resolve this issue? Re: Hard Fault in C40_Ip_MainInterfaceHVJobStatus api when flash is erase in s32k312 Hi Daniel. This issue is resolved. Thank you for your support. BRs. Eddie Park Re: Hard Fault in C40_Ip_MainInterfaceHVJobStatus api when flash is erase in s32k312 Hello @EddiePark, Please specify the RTD revision. Does the fault occur during or after the flash operation? If you are erasing the sector starting at 0x00400000, where is the application code located? As discussed here: https://community.nxp.com/t5/S32K/S32K344-C40-IP-Hardware-Fault-Problem/td-p/1697432 Place this function to SRAM too: C40_Ip_MainInterfaceHVJobStatus() Check the .map file to confirm the functions are in SRAM. Regards, Daniel
View full article
SAI_TxSetBitClockRate parameter questions I'm trying to set up SAI (send only, as master). But I'm confused by the SAI_TxSetBitClockRate parameters, documented as: /*! * brief Transmitter bit clock rate configurations. * * param base SAI base pointer. * param sourceClockHz, bit clock source frequency. * param sampleRate audio data sample rate. * param bitWidth, audio data bitWidth. * param channelNumbers, audio channel numbers. */ void SAI_TxSetBitClockRate( I2S_Type *base, uint32_t sourceClockHz, uint32_t sampleRate, uint32_t bitWidth, uint32_t channelNumbers) 1) What is uint32_t channelNumbers? In the code this seems to be used as numberOfChannels (ie 2 for stereo): uint32_t bitClockFreq = sampleRate * bitWidth * channelNumbers; 2) What is uint32_t sourceClockHz? Is this just the module's clock input, as generated by the clock tool, ie #define BOARD_BOOTCLOCKRUN_SAI1_CLK_ROOT 63529411UL Thanks in advance, Best Regards, Dave 回复: SAI_TxSetBitClockRate parameter questions Hi @davenadler , Thanks for your interest in NXP MIMXRT series! 1) What is uint32_t channelNumbers? In the code this seems to be used as numberOfChannels (ie 2 for stereo): >> Yes, you are right. 2) What is uint32_t sourceClockHz? Is this just the module's clock input, as generated by the clock tool, ie >> Yes. It is the clock frequency of the SAI peripheral. It is used to configure the appropriate BCLK.
View full article
在 s32k312 中擦除闪存时,C40_Ip_MainInterfaceHVJobStatus API 中发生硬故障 嗨,恩智浦团队。 硬故障(1.jpg)检查 S32K312 的扇区(0x00400000)擦除功能时出现问题。 以下 API 函数必须放入 SRAM(“.ramcode”部分),如附件(2.jpg)。 C40_Ip_MainInterfaceSectorErase C40_Ip_MainInterfaceSectorEraseStatus C40_Ip_MainInterfaceWrite C40_Ip_MainInterfaceWriteStatus 您能告诉我如何解决这个问题吗?
View full article
Questions about 'volatile' and 'static' keywords for global variables. Hello, In the demos of the MIMXRT1010 all global variables seem to be preceded by the 'volatile' keyword. And sometimes also the 'static' keyword. Why is that? These are global variables, not hard ware registers. And MIMXRT1010 has only one core (demos are written for one core anyway), so no problem if the value stays in cache. So why are these keywords needed? I ask this because I like to understand the code. But also when I put these keywords before some of my own global variables (that are structures) and I use a pointer to them, I get warnings like: ../source/sai_interrupt.c:245:27: warning: passing argument 1 of 'xs_biquad_init_LP' discards 'volatile' qualifier from pointer target type [-Wdiscarded-qualifiers] I could try to solve this, but if 'volatile' is not really needed I also could just skip it. Re: Questions about 'volatile' and 'static' keywords for global variables. Hi @simmania , If  "static" is used for global variables, it doesn't mean make the variables "static" or immutable. , the use of "static" is mainly  to restrict their scope, making global variables visible only within the file in which they are defined. BR  mayliu Re: Questions about 'volatile' and 'static' keywords for global variables. And what about the static keyword for global variables? Re: Questions about 'volatile' and 'static' keywords for global variables. Hi @mayliu1 , yes, this is a correct usage of volatile: #define ADC_RESULT_REGISTER ((volatile uint16_t*)0x4XXXXXXX)  Because you are referring here to a hardware register with possible side effects. But this volatile is wrong and needs to be deleted: volatile uint16_t usadc_result; Volatile is not justified here. Moreover, a global variable is not needed in your example, as you have implemented a getter for the ADC result. I hope that makes it clear. Re: Questions about 'volatile' and 'static' keywords for global variables. Hi @ErichStyger , Thanks for your update information. I want clarify my point 2 about Keyword "volatile". I mean the next situation.  For example :// Assuming this is the memory-mapped address of the ADC result register #define ADC_RESULT_REGISTER ((volatile uint16_t*)0x4XXXXXXX)  //Address is based on your MCU type // global variable "usadc_result" used to store the ADC result volatile uint16_t usadc_result; // This function is used to read the ADC result uint16_t read_adc_result() {     // Directly read the value from the ADC result register to a global variable     usadc_result = *ADC_RESULT_REGISTER;     return usadc_result; } Wish it helps you. If you still have question about it, please kindly let me know. Best Regards mayliu Re: Questions about 'volatile' and 'static' keywords for global variables. Hi @simmania, 'static' for data and functions means that it has 'internal linkage'. So it tells the linker that the static symbol is only part of that compilation unit and cannot be accessed (or linked) from the outside world. Think about 'static' used to limit the scope for the linking phase. I recommend that you might have a look at the following article on that subject: https://mcuoneclipse.com/2022/01/01/spilling-the-beans-storage-class-and-linkage-in-c-including-static-locals/ I hope this helps, Erich Re: Questions about 'volatile' and 'static' keywords for global variables. Hi BR, 'atomic' is a key aspect assessing if something can be reentrant or not. My point is that 'volatile' is a different concept and does not help you in any way with reentrancy or synchronization. Or in other words: using volatile for anything else than hardware registers is wrong and a programmer error (with few exceptions outlined in the article). I hope this clarifies it. Erich Re: Questions about 'volatile' and 'static' keywords for global variables. Hi @ErichStyger , Thank you so much for your interest in our products and for using our community. I have read your suggest link, I find this article is based on "atomic".  As I said before, there is no guarantee that its access will be atomic or free from race conditions. It is because the compiler and processor maybe optimized your code, resulted in variable reads and writes not occurring directly in memory but instead using register caching or other optimization techniques. Wish you a nice day! BR mayliu Re: Questions about 'volatile' and 'static' keywords for global variables. Hi @simmania , Thanks for your update. 1: Regarding the "static" keyword, my previous explanation maybe some misleading. If  "static" is used for global variables, it doesn't mean make the variables "static" or immutable. , the use of "static" is mainly  to restrict their scope, making global variables visible only within the file in which they are defined. If  "static" is  declared within a function, which retain their value between function calls instead of being reinitialized each time the function is called. 2: Regarding the "volatile" keyword, my reply is that in an RTOS  system, even if a variable is accessed on the same core and using the same cache, there is no guarantee that its access will be atomic or free from race conditions. It is because the compiler and processor maybe optimized your code, resulted in variable reads and writes are not occurring directly in memory but instead using register caching or other optimization techniques. If a other task, ISR  changed  the variable between when the code reads its value and when it accesses it again, the code may obtain an outdated value. Using the keyword "volatile"  tells  the compiler do not to optimize such variables ,and always read their values directly from memory, make sure that the code can correctly obtain the latest state of the variables. Wish it helps you. If you still have question about it, please kindly let me know. Best Regards mayliu Re: Questions about 'volatile' and 'static' keywords for global variables. Thanks for the answer. You say 'static' is used to maintain their value. But the static keyword is used on global variables that are read and written. They are not static at all. That is why it confuses me so much. So what do you main by maintain their value? You also say that 'volatile' is needed because variables may be changed in interrupt routines or other processes in a RTOS. I do not understand this. What is wrong with changing a variable in some other piece of code. If it is on the same core, using the same cache, what is wrong with that? Re: Questions about 'volatile' and 'static' keywords for global variables. Hi @mayliu1  Respectfully, I have to disagree 100% with your answer to point 2. I recommend to have a read at https://mcuoneclipse.com/2021/10/12/spilling-the-beans-volatile-qualifier/ or check the C/C++ language definition for volatile. 'volatile' is appropriate for hardware registers with side effects, as a workaround for compiler bugs, or as a qualifier for assembly code (but not needed there if the compiler is handling it correctly). It 'might' be used in a 'documentation like manner', but never to make code 'work'. If 'volatile' for non-hardware registers is used, this is a sign for bad or wrong code. If you are using 'volatile' for synchronization (e.g. the FreeRTOS case mentioned) or anything other than hardware registers with side effects, this is clearly wrong. You have to use proper synchronization primitives or correctly using critical sections. I hope this helps and clarifies this, Erich Re: Questions about 'volatile' and 'static' keywords for global variables. Hi @simmania , Thank you so much for your interest in our products and for using our community. Question: In the demos of the MIMXRT1010 all global variables seem to be preceded by the 'volatile' keyword. And sometimes also the 'static' keyword. Why is that? These are global variables, not hard ware registers. And MIMXRT1010 has only one core (demos are written for one core anyway), so no problem if the value stays in cache. So why are these keywords needed? Answer: Please see the explain these two 'volatile'  and  'static'  keyword  1: "static" keyword: It is used for limiting the scope and maintaining the variable value. 2:  "volatile" keyword: Even though the MIMXRT1010 has only one Arm Cortex®-M7 Core, It is still need use "volatile" keyword.       a: The global variables may be changed in interrupt ISR. In this case,   "volatile" keyword is needed.     b: As you said these are not hardware registers, but it still need "volatile" keyword, because  global variables may be used as an indirect means of interacting with hardware, for example, through memory-mapped I/O ,and so on.       c: If you use FREERTOS or other RTOS , global variables shared with multi tasks, In this case,   "volatile" keyword is needed. Question: I ask this because I like to understand the code. But also when I put these keywords before some of my own global variables (that are structures) and I use a pointer to them, I get warnings. Answer:  It might be because pointer operations do not compatible with the semantic definition of  keyword volatile. Wish it helps you. If you still have question about it, please kindly let me know. Best Regards mayliu
View full article
I can't probe my mcu-link debug probe I can't probe my mcu-link debug probe.  What I did:  I follow the instruction to update the muc-link. Installing drivers and updating firmware for MCU-Link Which seems to work according to the output of program_CMSIS.cmd from the MCU-LINK_installer.  Tried with Version  MCU-LINK_installer 2.263, 3.146 and 3.148. After that the red led is blinking smoothly. I tied to probes the MCU-Link with the LinkServer  1.6.133 and 24.9.75  booth exit with the same error. C:\NXP\LinkServer_1.6.133>LinkServer.exe probes ERROR: Failed to boot probes ERRMSG: ValueError: invalid literal for int() with base 16: 'E109_QC5GNRCOEXMGR' CRITICAL: Critical error ERRMSG: ValueError: invalid literal for int() with base 16: 'E109_QC5GNRCOEXMGR' Running on Windows 11 @brendonslade #MCU-LINK #LINKERSERVER  Re: I can't probe my mcu-link debug probe Thank you. That workaround works for me. Re: I can't probe my mcu-link debug probe Hi kaspt, We've analyzed the reports and found that there is an issue with handling on of the PIDs in your system. We will work on a fix in our next release,  but in the meantime please try this workaround: For version LinkServer_24.9.75, modify the “c:\\nxp\\LinkServer_24.9.75\\binaries\\Scripts\\listusb.vbs” script: change line: sPID = ReplaceX(sDvcID, ".*PID_([^\\\&\+]*).*", "$1") with:             sPID = ReplaceX(sDvcID, ".*PID_([^_\\\&\+]*).*", "$1") Let us know if this works for you. Re: I can't probe my mcu-link debug probe Program firmware  C:\NXP\MCU-LINK_installer_3.148\scripts\program_CMSIS CMSIS-DAP firmware for MCU-Link programming script V3.148 September 2024. Place the board in ISP USB mode using the appropriate jumper on your MCU-Link. Refer to the board documentation for more information. Connect board via USB then press Space. WARNING: This firmware version requires MCUXpresso IDE version 11.7.1 or later. Press any key to continue . . . Programming "MCU-LINK_CMSIS-DAP_V3_148.s19" Programmed successfully - To use: remove ISP jumper and reboot. Connect Next Board then press Space (or CTRL-C to Quit) Press any key to continue . . . probes log C:\NXP>LinkServer_24.9.75\LinkServer.exe -l5 probes --no-boot [229]DEBUG:asyncio: Using proactor: IocpProactor [229]DEBUG:launcher.core.redlinkserv: Starting redlinkserv: C:\NXP\LinkServer_24.9.75\binaries\redlinkserv.exe ['--port', '11111', '--telnetport', '12222', '--no-telnet-defaults'] [229]DEBUG:launcher.core.redlinkserv: Connecting to redlinkserv (localhost:12222) [249]DEBUG:launcher.core.redlinkserv: Connected to redlinkserv [249]DEBUG:launcher.core.redlinkserv: [read] [249]DEBUG:launcher.core.redlinkserv: [write] probelist [440]DEBUG:launcher.core.redlinkserv: [read] Index = 1 Manufacturer = NXP Semiconductors Description = MCU-LINK (r0FF) CMSIS-DAP V3.148 Serial Number = 4BBXRM21A3B4T VID:PID = 1FC9:0143 Path = 0002:0019:00 [440]DEBUG:launcher.core.probeboot: Listing usb devices [440]DEBUG:launcher.core.utils: Subprocess exec: cscript ['/nologo', 'C:\\NXP\\LinkServer_24.9.75\\binaries\\Scripts\\listusb.vbs'] [1594]DEBUG:launcher.core.redlinkserv: [write] exit [1609]DEBUG:launcher.core.redlinkserv: Waiting for redlinkserv to close [1840]DEBUG:launcher.core.redlinkserv: Redlinkserv has closed [1840]CRITICAL:__main__: Critical error Traceback (most recent call last): File "launcher\__main__.py", line 39, in File "click\core.py", line 1130, in __call__ File "click\core.py", line 1055, in main File "click\core.py", line 1657, in invoke File "click\core.py", line 1404, in invoke File "click\core.py", line 760, in invoke File "launcher\cli\utils\funcs.py", line 145, in wrapper File "asyncio\runners.py", line 190, in run File "asyncio\runners.py", line 118, in run File "asyncio\base_events.py", line 654, in run_until_complete File "launcher\cli\cmd\probes.py", line 84, in cmd_probes File "launcher\core\redlinkserv.py", line 333, in cmd_probelist File "launcher\core\probeboot.py", line 126, in list_usb File "launcher\core\probeboot.py", line 128, in ValueError: invalid literal for int() with base 16: 'E109_QC5GNRCOEXMGR' List usb devices  C:\NXP>usbipd list Connected: BUSID VID:PID DEVICE STATE 2-3 1fc9:0143 MCU-LINK (r0FF) CMSIS-DAP V3.148, USB Input Device, MCU-L... Not shared 2-6 1bcf:2bb3 Camera AI Effect Opt-in, APP Mode Not shared 2-10 8087:0033 Intel(R) Wireless Bluetooth(R) Not shared C:\NXP>cscript /nologo c:\\nxp\\LinkServer_24.9.75\\binaries\\Scripts\\listusb.vbs VID: 1FC9 PID: 0143 Serial: 7&1B09FF6B&0&0000 VID: 8086 PID: 7EC3 Serial: 4&1F0EBEEC&0&0 VID: 0489 PID: E109_QC5GNRCOEXMGR Serial: 6&246D92E1&0&04 VID: 8087 PID: 0AC2 Serial: 7&3F876ED&0&0000 VID: 8087 PID: 0AC2 Serial: 6&2BC0E6A5&0&00 VID: 0489 PID: E109_QCGNSS Serial: 6&246D92E1&0&01 VID: 1BCF PID: 2BB3 Serial: 6&2C833700&0&0002 VID: 1FC9 PID: 0143 Serial: 4BBXRM21A3B4T VID: 0489 PID: E109_QCPSAUTOREG Serial: 6&246D92E1&0&03 VID: 1FC9 PID: 0143 Serial: 6&2CEB9B2&0&0002 VID: 1FC9 PID: 0143 Serial: 6&2CEB9B2&0&0001 VID: 1BCF PID: 2BB3 Serial: 01.00.00 VID: 8087 PID: 0033 Serial: 5&290E2439&0&10 VID: 1FC9 PID: 0143 Serial: 6&2CEB9B2&0&0000 VID: 0489 PID: E109_QCMBBNETADAPTER Serial: 6&246D92E1&0&02 VID: 1BCF PID: 2BB3 Serial: 6&2C833700&0&0000 Re: I can't probe my mcu-link debug probe Hi kaspt, Your error is a strange one - we havent see anything quite like it before. can you try running LinkServer like this: “c:\nxp\LinkServer_24.9.75\LinkServer.exe -l5 probes --no-boot” ...and check the output reported by: “cscript /nologo c:\\nxp\\LinkServer_24.9.75\\binaries\\Scripts\\listusb.vbs” command. If possible, please also try another computer. Please do the steps above with the latest firmware version programmed into the MCU-Link, and ensure the ISP jumper is removed and the board has been power cycled after programming. thanks Brendon Re: I can't probe my mcu-link debug probe Yes, I removed the jumper J3 MCU-link (not pro version) and disconnect and reconnect the USB.  Re: I can't probe my mcu-link debug probe Hello, my name is Pavel, and I will be supporting your case, did you remove the jumper of ISP and reset your device? Best regards, Pavel
View full article
Issue with imx8mp and embedding several DTBs in FIT image for SPL stuck in ddr training Hi,    We are trying to have multiple device trees in SPL using evaluation kit board imx8mp-evk and uboot 2023.04. To achieve this we enabled few u-boot configuration options: CONFIG_SPL_OF_CONTROL, CONFIG_SPL_MULTI_DTB_FIT and CONFIG_SPL_MULTI_DTB_FIT_NO_COMPRESSION. And for start we are providing just one device tree in SPL list: CONFIG_SPL_OF_LIST="imx8mp-evk" Reading specific value from EEPROM in board_fit_config_name_match() we set proper device tree. Problem that we see now when we try to boot platform with multiple dtb fit image is that dram phy is hanging in SPL in DRAM phy training. U-Boot SPL 2023.04-5.4.70-2.3.3 (Nov 26 2024 - 12:56:43 +0000) DDRINFO: start DRAM init DDRINFO: DRAM rate 4000MTS Adding some printouts to SPL functions we found out that code is stuck in infinite loop in call: ddr_cfg_phy()->wait_ddrphy_training_complete()->get_mail()->poll_pmu_message_ready() Read registry function in poll_pmu_message_ready() is returning all the time 0x10 value. Can you tell us if this feature is supported imx8mp, and if it is we missing some configuration options? We are building ixm-boot image in custom yocto environment there recipe for imx firmware is "firmware-imx-8m-mp_8.10.1.bb". We tried booting platform from sdcard and using uuu-tool and behavior is same.   Thank you, Sinisa i.MX 8M | i.MX 8M Mini | i.MX 8M Nano Re: Issue with imx8mp and embedding several DTBs in FIT image for SPL stuck in ddr training Thanks for your reply. I am currently working with Pro Support on this issue. Rick Stievenart Johnson Outdoors, Inc. Marine Electronics-Humminbird Re: Issue with imx8mp and embedding several DTBs in FIT image for SPL stuck in ddr training Hi Rick, Unfortunately, I found more issues. The trouble with loading the DDR training firmware is that the firmware offset isn’t calculated properly when multiple DTBs are embedded into the SPL image. To move forward, I used a hardcoded offset calculated from a memory dump. However, the next issue appeared when the SPL had to start U-Boot and pass the device tree. The device tree is always taken from the imx-boot image that the imx-boot tool in the soc.mak scripts packs, not the one selected by the SPL in board_fit_config_name_match(). Best regards, Sinisa Vik Re: Issue with imx8mp and embedding several DTBs in FIT image for SPL stuck in ddr training Greetings! I have the same issue! Did you ever find a REAL solution? Thank you for you reply! Rick Stievenart rick.stievenart@johnsonoutdoors Johnson Outdoors - Marine Electronics - Humminbird Re: Issue with imx8mp and embedding several DTBs in FIT image for SPL stuck in ddr training Hello, Unfortunately I believe we may not have this feature enabled or ready by default, as I was checking on the documentation, I see that SPL uses board_fit_config_name_match() to find the correct DTB within the FIT, as in our case this function is empty, as you can see here: https://github.com/nxp-imx/uboot-imx/blob/lf_v2022.04/board/freescale/imx8mp_evk/spl.c#L140 This may be causing issues on the SPL, please note that this feature has not been tested on our side. Best regards/Saludos, Aldo. Re: Issue with imx8mp and embedding several DTBs in FIT image for SPL stuck in ddr training Hi Aldo, Basically without these additional configuration options platform is booting correctly (it is default unchanged imx8mp_evk_defconfig). We have custom board based on imx8mp processor and we want to support booting multiple variants of that platform with single bootloader image. Our idea is that SPL provides correct device tree to u-boot based on specific identifier from eeprom. We observe same behavior if we modify our bootloader configuration as for evk platform, SPL hang in ddr_cfg_phy(). As starting point we are tying to resolve this problem on NXP evaluation kit platform with clean u-boot source since it's not affected by our changes. First we observe this hang when we packed multiple device tree into bootloader fit image: CONFIG_SPL_OF_LIST="imx8mp-evk imx8mp-evk-2". imx8mp-evk-2.dts was copy of imx8mp-evk.dts with modified model property node. Alternative on the end was to enable this feature and specify just one device tree in CONFIG_SPL_OF_LIST. If you need more detailed steps pleas let me know. Re: Issue with imx8mp and embedding several DTBs in FIT image for SPL stuck in ddr training Hello, If you do not enable this feature does the board boot correctly? Also, what do you mean by multiple device tree? Could you share more information of what are you trying to achieve? Best regards/Saludos, Aldo.
View full article
IMXRT1010 SAI transfer I'm developing a project that convolve an IR with the data acquired by the codec; I use the IMXRT1010 board. I take the SDK example and I modify it to get what I need to do the convolution. The example use this function to receive the data: * @brief Performs an interrupt non-blocking receive transfer on SAI. * @note This API returns immediately after the transfer initiates. * Call the SAI_RxGetTransferStatusIRQ to poll the transfer status and check whether * the transfer is finished. If the return status is not kStatus_SAI_Busy, the transfer * is finished. * * @param base SAI base pointer * @param handle Pointer to the sai_handle_t structure which stores the transfer state. * @param xfer Pointer to the sai_transfer_t structure. * @retval kStatus_Success Successfully started the data receive. * @retval kStatus_SAI_RxBusy Previous receive still not finished. * @retval kStatus_InvalidArgument The input parameter is invalid. */ status_t SAI_TransferReceiveNonBlocking(I2S_Type *base, sai_handle_t *handle, sai_transfer_t *xfer); and the function: SAI_TransferSendNonBlocking(....) to send the data. Both need to check the status: ---> Call the SAI_RxGetTransferStatusIRQ  ---> Call the SAI_TxGetTransferStatusIRQ The problem is that I don't find the status check routines; may you help me ? Thanks. Luigi Re: IMXRT1010 SAI transfer Thank you Sam, great !! Re: IMXRT1010 SAI transfer Hi @LuigiV  Certainly! Thanks for your questions, plz see my comments below, please correct me if my understanding is wrong. To perform non-blocking data transfer using the SAI (Serial Audio Interface) module on the IMXRT1010 board, you need to use the provided functions and check the transfer status properly. The functions you mentioned (`SAI_TransferReceiveNonBlocking` and `SAI_TransferSendNonBlocking`) initiate the transfer, and you need to check the status using the appropriate status functions.  The functions like `SAI_RxGetTransferStatusIRQ` and `SAI_TxGetTransferStatusIRQ` are used to check the status of the receive and transmit transfers, respectively. These functions might not be directly named as such, but they are part of the SAI driver in the SDK. Here's how you typically use them: ### Receiving Data To receive data non-blocking, you need to initialize the SAI module, create a transfer handle, and initiate the receive transfer. Then, you periodically check the status to see if the transfer is complete. #include "fsl_sai.h" #include "fsl_debug_console.h" #include "board.h" #define EXAMPLE_SAI SAI1 #define EXAMPLE_SAI_CHANNEL (0) #define BUFFER_SIZE (1024U) sai_handle_t rxHandle; uint8_t rxBuffer[BUFFER_SIZE]; volatile bool isRxFinished = false; // Callback function for receive void SAI_UserRxIRQHandler(I2S_Type *base, sai_handle_t *handle, status_t status, void *userData) { if (status == kStatus_SAI_RxIdle) { isRxFinished = true; } } void InitSAI(void) { sai_config_t config; SAI_TxGetDefaultConfig(&config); SAI_Init(EXAMPLE_SAI); SAI_TransferRxCreateHandle(EXAMPLE_SAI, &rxHandle, SAI_UserRxIRQHandler, NULL); SAI_TransferRxSetConfig(EXAMPLE_SAI, &rxHandle, &config); } void StartReceive(void) { sai_transfer_t xfer; xfer.data = rxBuffer; xfer.dataSize = BUFFER_SIZE; if (SAI_TransferReceiveNonBlocking(EXAMPLE_SAI, &rxHandle, &xfer) != kStatus_Success) { PRINTF("Failed to start receive transfer.\r\n"); } } int main(void) { BOARD_InitBootPins(); BOARD_InitBootClocks(); BOARD_InitDebugConsole(); InitSAI(); StartReceive(); while (!isRxFinished) { // Poll the transfer status status_t status = SAI_TransferGetReceiveCount(EXAMPLE_SAI, &rxHandle); if (status == kStatus_SAI_RxError) { PRINTF("Receive error occurred.\r\n"); break; } } PRINTF("Receive finished.\r\n"); while (1) { } } ``` ### Transmitting Data Similarly, for transmitting data, you initialize the SAI module, create a transfer handle, and initiate the transmit transfer. Then, you periodically check the status to see if the transfer is complete. ```c #include "fsl_sai.h" #include "fsl_debug_console.h" #include "board.h" #define EXAMPLE_SAI SAI1 #define EXAMPLE_SAI_CHANNEL (0) #define BUFFER_SIZE (1024U) sai_handle_t txHandle; uint8_t txBuffer[BUFFER_SIZE]; volatile bool isTxFinished = false; // Callback function for transmit void SAI_UserTxIRQHandler(I2S_Type *base, sai_handle_t *handle, status_t status, void *userData) { if (status == kStatus_SAI_TxIdle) { isTxFinished = true; } } void InitSAI(void) { sai_config_t config; SAI_TxGetDefaultConfig(&config); SAI_Init(EXAMPLE_SAI); SAI_TransferTxCreateHandle(EXAMPLE_SAI, &txHandle, SAI_UserTxIRQHandler, NULL); SAI_TransferTxSetConfig(EXAMPLE_SAI, &txHandle, &config); } void StartTransmit(void) { sai_transfer_t xfer; xfer.data = txBuffer; xfer.dataSize = BUFFER_SIZE; if (SAI_TransferSendNonBlocking(EXAMPLE_SAI, &txHandle, &xfer) != kStatus_Success) { PRINTF("Failed to start transmit transfer.\r\n"); } } int main(void) { BOARD_InitBootPins(); BOARD_InitBootClocks(); BOARD_InitDebugConsole(); InitSAI(); StartTransmit(); while (!isTxFinished) { // Poll the transfer status status_t status = SAI_TransferGetSendCount(EXAMPLE_SAI, &txHandle); if (status == kStatus_SAI_TxError) { PRINTF("Transmit error occurred.\r\n"); break; } } PRINTF("Transmit finished.\r\n"); while (1) { } } ``` ### Notes 1. Interrupt Handler: The callback functions `SAI_UserRxIRQHandler` and `SAI_UserTxIRQHandler` handle the interrupt service routines. They set a flag when the transfer is finished. 2. Polling Status: In the main loop, the status is periodically checked using `SAI_TransferGetReceiveCount` and `SAI_TransferGetSendCount` functions to determine if the transfer is complete. 3. SDK Documentation: Ensure to refer to the specific SDK documentation for your board and SAI driver functions as there might be slight variations in function names or parameters. By following the above examples, you should be able to perform non-blocking transfers with status checks on the IMXRT1010 board. Have a nice day! Sam
View full article
使用 CAN LLCE 时在长消息缓冲区中接收标准短 CAN 帧 尊敬的恩智浦社区成员: 我目前正在使用 LLCE 固件 v1.0.7 在 S32G274A 评估板。 当我通过 CAN 日志工具向 LLCE 发送一个 CAN 标准帧(8 字节)时,它会将其视为一个长帧(大于 8 字节)。因此,当我获取 Rx 描述符表索引时,我发现它低于与长帧相对应的 LLCE_CAN_CONFIG_MAXRXMB(1732)。 我应该获得大于LLCE_CAN_CONFIG_MAXRXMB 的索引,因为我只向 LLCE 发送短帧。 你知道是什么原因导致了这种行为吗? 感谢您的支持。 此致,
View full article
IMX8MP spread spectrum Hello, I wanna add spread spectrum for my IMX8MP LVDS screen signal. I find that the feature is available for 8QuadMax and i.MX 8QuadXPlus Display but not for i.MX 8MP. Do you know when this will be available or there is already a patch to add it ? Thanks. Re: IMX8MP spread spectrum It works, thank you. Re: IMX8MP spread spectrum Hi @clemntnxp,  Thank you for contacting NXP Support. On our i.MX8MP EVK the enablement of Spread Spectrum Clocking is via software. We don't have any code example to apply the required changes. Here is a description of Spread Spectrum enablement for LVDS interface. The LVDS interface doesn't have an integrated PLL such as MIPI or USB interface, therefore, LDB (LVDS Display Bridge) module uses VIDEO_PLL1 as root clock and VIDEO_PLL1 support SSCG (Spread Spectrum Clock Generator). Here is a block diagram of LVDS interface on iMX8M Plus. To enable the Spread Spectrum Clocking for LVDS interface you will need to write on VIDEO_PLL1 control register. You will need to set SSCG_EN and the other parameters (MFR, MRR, SEL_PF, SEL_PF) with U-Boot. For a proper setting up, please have a look to the section 5.1.5.4.4 SSCG and Fractional PLLs on the i.MX8MP Reference Manual. Have a great day!
View full article
CAN LLCE 使用時の長いメッセージバッファでの標準ショート CAN フレームの受信 親愛なるNXPコミュニティ、 現在、LLC Eファームウェアv1.0.7 on S32G274A evalボードを使用しています。 CAN 標準フレーム (8 バイト) を CAN log ツール経由で LLCE に送信すると、長いフレーム (8 バイト以上) であるかのように処理されます。したがって、Rx記述子テーブルインデックスを取得すると、長いフレームに対応するLLCE_CAN_CONFIG_MAXRXMB(1732)よりも低いことがわかりました。 私は短いフレームだけをLLCEに送信するので、LLCE_CAN_CONFIG_MAXRXMB より大きいインデックスを取得するべきでした。 この行動の原因について何か考えはありますか? 再開まで今しばらくお待ちください。 よろしくお願いいたします
View full article
Reception of standard short CAN frames in long message buffers when using CAN LLCE Dear NXP community, I'm currently using LLCE firmware v1.0.7 on S32G274A eval board. When I send a CAN standard frame (8bytes), via my CAN log tool, to the LLCE, it handles it as if it is a long frame (greater than 8Bytes).So When I get the Rx descriptor table index, I found it lower than LLCE_CAN_CONFIG_MAXRXMB (1732) which corresponds to the long frames. I should have gotten an index greater than LLCE_CAN_CONFIG_MAXRXMB because I send to LLCE only short frames. Do you have any idea about what can cause this behavior ? Thank you for your support.  Best regards, Re: Reception of standard short CAN frames in long message buffers when using CAN LLCE Hi @Daniel-Aguirre , Indeed you are right. I solved the problem. The issue was due to the fact that I've not set Llce_CanRx_MbLengthType to the correct value. Thank you for your support. Best regards, Re: Reception of standard short CAN frames in long message buffers when using CAN LLCE Hi, Are you using any of the NXP available examples? Can you share with us the configuration for the CanHardwareObject you are using and shows the behavior? How did you configure the CanObject Payload Lenght? For the information, there is only 2 types of messages and it is defined by the following structure: Seems to be a misconfiguration of the filter at this moment. Please, let us know.
View full article