S32K ナレッジベース

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

S32K Knowledge Base

ラベル

ディスカッション

ソート順:
******************************************************************************* * * The purpose of this demo application is to present a usage of the ADC_SAR and * BCTU IP Driver for the S32K3xx MCU. * * The example uses the PIT0 trigger to trigger BCTU conversion list. Five standard * ADC channels are selected to be converted. * Converted result from BCTU data register are moved by DMA into result array. * This result array should be placed into no cacheable area if data cache is enabled. * * ADC channel S10 is connected to board's potentiometer, and converted value is * used to dim board's LED. * * * ------------------------------------------------------------------------------ * Test HW: S32K3X4EVB-Q172 * MCU: S32K344 * Compiler: S32DS3.4 * SDK release: RTD 1.0.0 * Debugger: Lauterbach * Target: internal_FLASH ********************************************************************************
記事全体を表示
******************************************************************************** The purpose of this demo application is to show you the usage of the FlexCAN module configured to use CAN FD and Enhance RXFIFO using the S32 RTD API. - This demo application requires two boards, or single board connected with CAN tool. - CAN FD is enabled with bitrate 500/2000 kbps - MB0 is configured to transmit either std. or ext ID - MB1 is configured to receive ext ID 0xFACE and MB2 to receive std ID 0x1 - Enhanced RXFIFO is enabled and 3 enhanced RXFIFO filter elements (filter + mask scheme) are defined ext ID 0xABCD with mask 0x1FFFFFFF std ID 0x123 with mask 0x7FF std ID 0x456 with mask 0x7FF - Callback function is used as well to handle TX and RX process in MBs and Enhanced RXFIFO - setupCanXCVR function can be called if TJA1153 is used on the board. It expects transceiver in Vanilla state and set TPL to pass all std and ext ID and do not block any message comming from bus. Finally leaving configuration mode without writing to non-volatile memory nor locking the transceiver. * * ------------------------------------------------------------------------------ * Test HW: S32K3444EVB-Q172 * MCU: PS32K344EHVPBS 1P55A * Compiler: S32DS.ARM.3.4 * SDK release: SW32K3_RTD_4_4_2_0_0_D2203 * Debugger: Lauterbach * Target: internal_FLASH * ********************************************************************************
記事全体を表示
       This routine implements all four different mask setting methods.Users can refer to these routines to implement some application scenarios.Please note that this routine is for reference only.When posting this routine, I only did some limited tests, and I don't make sure that there are no problems. If you find it, please leave a message and I will revise it in time.       When the program was flashed into the S32K142EVB, the Blue Led will toggles every 500ms, this Led shows that the program is running on well condictions. If a message was received by S32K142EVB from external CAN bus, the Green Led will toggle,at the same time, the S32K142EVB will sent a message to CAN Bus which have the same data with the message received,and the ID is 0x02.At the last,the Red Led will toggle when a CAN error is occurd.   1.FlexCAN Mask Setting Overview          S32K1XX FlexCAN support  Frame mask function ,as you can see the FlexCAN mask can be set to Global Mask or Individual Mask,and user can choose to use FIFO or MB to receive message,but only MB can be used for sending messages.and one more thing you should be care is that the FIFO can not be used for CAN FD,this is because the FIFO data filed only support 8 bit datafiled.           If you use MB14 or MB15, have to set the mask of these tow MBs separately,and you can take a look at the two functions in the below. ->FLEXCAN_DRV_SetRxMb14Mask();  ->FLEXCAN_DRV_SetRxMb15Mask();   2.Hardware Needs. 1.S32k142EVB,(or own made board which can support CAN communications.) 2.CAN TOOL's which used for send or receive messages from CAN Bus on your computer.   If you don't have such tools ,you can use another board which can replace the CAN tools to send or receive CAN messages. 3.S32K142EVB should be powered by external 12V DC, and don't forget to connect the J107 to 1-2.   3.Software Needs. 1.This demo build on S32 Design Studio for ARM V2.2  2.The SDK version is SDK_S32K1XX_15   4.FlexCAN_RX_MB_Mask_Setting 4.1.Set the Mask Type to Global Mask Type.      In this case, we can only receive the messages which ID from 0x300~0x37F and 0x400~0x47F.      If you try to sent the messages with other ID's, the S32K142EVB will not have any reponse!  4.2.Set the Mask Type to Individual Mask Type.      In this routine,we can only receive frames with IDs in the range of 0x400~0x47F. 5.FlexCAN_RX_FIFO_Mask_Setting 5.1.Set the Mask Type to Global Mask Type.      In this routine,we can only receive frames with IDs in the range of 0x10~0x17, 0x20~0x27,0x30~0x37,0x40~0x47, 0x50~0x57,0x60~0x67,0x70~0x77,0x80~0x87. 5.2.Set the Mask Type to Individual Mask Type.      In this routine, we can only receive frames with IDs in the range of 0x10~0x17,0x20~0x27,0x30~0x37,0x40~0x47, 0x50~0x57,0x60~0x67,0x70~0x77,0x80~0x87.   End       If you need to use CAN FD, please note that FIFO cannot be used. Regarding FIFO, it has three filtering formats, you can refer to the following chapters in the data sheet for details. S32K-RM Rev 13. Chapter:55.4.2.15 Rx FIFO Global Mask register (RXFGMASK) Chapter:55.4.6 Rx FIFO structure          
記事全体を表示
           The hardware of this routine is based on S32K142EVB, the IDE is S32_Design_Studio for ARM 2018.R1, SDK version is S32K1xx_RTM_3.0.0, PTB12 is used to simulate Hall pulse output,PTC12 and PTC13 are buttons to change the flip frequency of PTB12 port, and PTB13 is used as the input capture port. When using the demo program in this article, you need to connect PTB12 and PTB13 ports.   Here we assume that we are using a brushed DC motor!   1.The Hall sensor       The Hall sensor is a magnetic induction sensor. The magnetic ring and the Hall element form an induction combination. The magnetic ring rotates with the rotor. The Hall induction magnetic ring rotates with the rotor. , 3-pole pairs, 4-pole pairs, etc., each pair of poles is divided into two levels of N.S. A pair of magnetic poles outputs one pulse signal, and multiple magnetic poles output multiple pulse signals. The number of magnetic pole stages determines the number of pulse signals. , the higher the accuracy.   Hall sensor 2.The relationship between the motor magnetic ring series and the output Hall waveform 5 pole pairs 3.Determination of motor rotation direction         The direction of the motor is judged by the phase difference of the two Hall signals. As shown in the figure below, the phase of Sensor A is ahead of Sensor B, so it can be considered that the current rotation direction of the motor is clockwise.   4.Calculation of motor speed         The speed of the motor can be calculated by the pulse width of the pulse, and the number of revolutions of the motor can be calculated by the number of pulses. Assuming that the Hall magnetic ring of the motor has 5 pairs of poles, it means that there are five pulses in one revolution of the motor, and the speed of the motor = 60 / (t1 * 5) rev/min. The number of pulses can be obtained by the edge capture function of the FTM. Motor speed and stroke         Assuming that the clock of the FTM is 2MHz, then it takes 1/2000000 seconds for the counter to add 1. Since the unit of the motor speed is rpm, the calculation formula of the motor speed is : -> Motor Speed = 60 / (5 * a* (1 / 2000000))         In this formula, '5' is the number of pole pairs of the magnetic ring, and 'a' is the difference of the counter corresponding to the falling edge of two consecutive pules.         Let’s do a test, the square wave in the below figure is the outputs of PTB12, and the output pulse period is 32.1ms. Then the time required for the motor to rotate once should be:32.1ms *5 = 160.5ms, then the speed of the motor should be: 60 * 1000 / 160.5 = 373.83rpm.   PTB2 output square wave          The below picture is directly obtained by the debugger. It can be seen that the speed of the motor at this time is 373, which is not much different from the value measured by the oscilloscope, which is 373.83. This is because I did not use the floating-point calculation result in the program. In summary, we use the input capture function of the FTM module completes the calculation of the motor speed.   debuger monitor results 5.How to calculate the direction of rotation of the motor         Above we calculated the speed of the motor, but did not make judgement on the direction of the rotation of the motor. As mentioned above, the rotation direction of the motor is judged by the phase difference of the two Hall pulse waveforms. Usually, we think of using the timestamp to judge the current state of the phase, so we will enable the two input captures, and then calculate the two Halls timestamp of the falling edge of the pulse.         In fact, there is a simpler method, it only needs to read the high and low state of the other Hall pulse level when the falling edge of one hall pulse is interrupted. In short, we only need to enable one input capture, and the other to be used as a GPIO port.
記事全体を表示
Hi all, Recently, we completed S32K Sound Mixer reference code and demo, and glad to share this demo at here.   Some key feature of this demo:  - Demo HW based on S32K344/S32K148 + audio codec SGTL5000 + QSPI flash MX25L6433.  - Demo SW based on S32K3 RTD RTM 2.0.0 and S32K1 RTD RTM 1.0.0.  - Demo provided 2 kinds of sound mixing algorithm realization code, and corresponding audio materials and codec SGTL5000 driver.  - Demo showed how to programming QSPI flash and its AHB accessing via audio storage and playing process.  - Demo used mono audio as source for processing, and output stereo audio (I2S format) via SAI HW FIFO combine (Line_Mux) function with nearly no extra cost.   HMI/Cluster apps need multiple audio sources (usually warning sounds) be played simultaneously, which brings sound mixing ability requirement. However, S32K1/3 lack of this HW/SW feature support. With the demand from local key customer, and considering potential customer requirements, we planned to enable a SW sound mixer with scheduled peripherals, to enhance the S32K family audio mixing ability. It shall be easy of using/porting on S32K1/3, and use QSPI flash (AHB mode read) to store the music. Attachment the Sound Mixer package includes 2 sound mixing examples based on S32K344 EVB and S32K148 T-Box RDB, and some slides to introduce this implementation and quick start guide.    Thanks and welcome any comment from you. Best Regards, Shuailin Li
記事全体を表示
Symptoms Recently found the compatibility issue is a troublesome problem especially when we are supporting different version of RTD. Remove/install the RTD SDK and plug, but it is not a perfect way because reinstall the RTD would cause a lot of time, sometimes it is unreliable. Diagnosis After investigated the mechanism of CT and MEX file, and found a work around to let the old project can be run in new version of RTD basis. Solution Already tested it with several reference code and examples of RTD, it can work. Attached is the document.
記事全体を表示
Symptoms   Diagnosis   Solution  
記事全体を表示
Symptoms   Diagnosis   Solution  
記事全体を表示
This article is written in Chinese. It is mainly for the disty and mass market customers in local China. It is useful for the the developers who is newly in touch with S32K1, and will help them install several software of S32K1, otherwise it may waste a lot of time.     S32DS中快速搭建S32K1的开发环境 一.背景 我最近换装了新电脑,需要重新安装S32DS,发现存在很多问题。尤其是对比之前的安装过程,发现官网的很多链接已经失效,甚至有一定的迷惑性。 最新的S32K1安装包比较隐蔽,而且安装存在前后依赖,对于刚接触NXP S32系列的新手非常不友好,所以写这篇文档总结一下典型的问题和解决方法。 同时也希望提供一个check的思路和步骤,在后续新版本发布时,升级IDE的时候更方便找到合适的安装包。 二.S32DS中各个包依赖关系解析 在S32DS中,每一个系列的MCU,总共需要安装两个插件包,一个是基础依赖包,一个是SDK(也叫RTD,同一个意思)。 1.基础依赖包 这个包对应S32DS版本,比如当前的3.4.3,官网可以下载离线版,一般大小在3GB左右,会更新S32DS中的很多组件,如下图1所示:            图1 尤其需要关注图1中红框的内容,没有这个development package的话,是无法进行对应MCU的debug。 图1中安装的包,对应到S32DS中安装的内容如图2所示:            图2 2.RTD安装包(与SDK同义) 这个包对应于RTD版本,也会标识AutoSAR的版本,比如最新的2.0.0,AutoSar 4.4,如图3所示:           图3 基础依赖包与RTD安装包存在前后依赖关系,如果不安装基础依赖包直接安装RTD,在安装时会报错。另外,我们下载的RTD包,即使写明是K3,里面也会包含K1的RTD,这点需要注意。如果此时还没有装K1的development package,就会出错。 三.S32K1开发环境搭建 官网对于S32K3的软件划分为standard software和reference software,其中S32DS和基础依赖包在standard software中,可以很方便的找到。 但S32K1的官网却仅有一个reference software,页面也只能找到几个RTD(或SDK)链接:                                                                             图4 这里面所有的链接都不是我们需要的,全是RTD。问题就出在这里,K1的网页中没有K1的基础依赖包!而前面讲过,缺基础依赖包会导致RTD也无法安装。经过我研究,K1的基础依赖包隐藏的非常深,可以通过两个方法找到: 从S32K1的reference software进去,然后重新点击product list,如下图5所              图5         进入如下页面,如图6所示,这里最能看出来,针对K1的界面很不友好,需要点最底下的NXP Software.              图6 在NXP.com官网首页搜索栏直接搜S32DS,找到S32 Design Studio for S32 Platform(注意不要选成for ARM或或者for PowerPC),从S32DS的主界面进入,然后一直下拉,找到S32DS service pack 1,这个才是K1的,如图7所示:                 图7 这个链接更加隐蔽,要在40多个选项里挨个找。   经过上面两个方法,都可以进入图8所示的界面,然后再按图8所示操作:              图8   这回终于到了最终可以下载S32K1基础依赖包的地方,如图9所示。我们需要重点关注一下命名,SW32开头的,会包含所有S32的development package,包括K1,K3,G;SW32K1开头的,仅有K1,同理如果你在K3的界面中,可以看到SW32K3开头的。            图9 下载最新版本的S32K1基础依赖包,然后再安装RTD,大功告成。
記事全体を表示
****************************************************************************************************  Detailed Description:  The current RTD RTM 2.0.0 does not support overflow notification  if EMIOS ICU is used in the Edge Detect mode.  Workaround is to use another channel in ECU mode  clocked by the same counter bus as the ICU channel.  Emios_0 input clock: 48MHz CORE_CLK  MCL EMIOS_0_Ch_23 (BUS_A)  Global clock devider: 48  MCB prescaler: 1  MCB clock: 1MHz  MCB tick: 1us  MCB period: 65_535 ticks  Both OCU (Emios_0_Ch0) and ICU (Emios_0_ch3) use the same BUS_A counter clock.  GPIO generated PWM period: ~0.5s  That's 500_000 ticks  ICU routed to PTB0  GPIO PWM to PTB1  -----------------------------------------------------------------------------------------------  Test HW: S32K3X4EVB-Q172  MCU: S32K344  Debugger: S32DS 3.4, PEMicro Multilink rev.C  Target: internal_FLASH ****************************************************************************************************
記事全体を表示
************************************************************************************************************************** * Detailed Description: * * Connect PTC24 (PWM) to PTC25 (IC) * * PWM signal generated by EMIOS_1_ch0 (in OPWFMB mode) is measured by EMIOS_1_ch_1 (IPWM mode). * * EMIOS_1 global global clock (core clock = 48MHz) prescaled in EMIOS_Mcl driver (/48) = 1MHz. * * BUS_A generated by EMIOS_1_ch_23 * Tick = 10us (1MHz global clock prescaled by 10 = 100kHz) * * PWM (OPWFMB), EMIOS_1_ch_0, PTC24 * Tick = 10us (1MHz global clock prescaled by 10 = 100kHz) * * IC (IPWM), EMIOS_1_ch_1, PTC25 * Clocked by BUS_A * Tick = 10us * * ------------------------------------------------------------------------------------------------------------------------ * Test HW: S32K3X4EVB-Q172 * MCU: S32K344 * Debugger: S32DS 3.4, PEMicro Multilink rev.C * Target: internal_FLASH **************************************************************************************************************************
記事全体を表示
  EV/HEV is the mega trend and NXP focused area. E-Compressor controller is a key and additional component of EV/HEV vs. traditional vehicle. While S32K14x is the perfect product for mainstream E-compressor application. To accelerate customer develop period in automotive E-compressor application, we develop the S32K142-ECC RDB. Actually, S32K142-ECC is not only suitable for E-compressor, but also can be used in other high voltage PMSM/BLDC application in automotive industry. This RDB (Reference Design Board) hardware is based on NXP S32K142 high-performance automotive-grade MCU and UJA1075A SBC (system basic chip) provides the following features: ◼ Support high voltage up to 400V and power range up to 3.7kW BLDC/PMSM applications. ◼ Support high voltage isolated 12V power supply, which for SBC, IPM and MCU power supply. ◼ Hardware support 3 types of current sampling solutions: single shunt, dual shunts and triple shunts; software support dual shunts in V1.0. ◼ Support multiple diagnose and protection covering UV, OV, OT, OC, Short, Stall Detection, etc.; ◼ Support speed/control commands from CAN/LIN/FreeMASTER; ◼ Support external watch dog for safety. the RDB hardware system block diagram is as below: The software package of S32K142-ECC RDB is available to enable user to evaluate the S32K142 based high voltage e-compressor motor control performance with out-of-box and build their own e-compressor motor control product prototype as a general high voltage motor control hardware platform. The software package has the following features: ◼ Support e-compressor control by FreeMASTER CAN/UART; ◼ Support e-compressor speed control and state feedback by CAN DBC file; ◼ Implemented advanced motor control algorithm, including low speed torque compensation, MTPA, 2-stage current alignment and enhanced ATO to make sure the motor robust start up and high efficiency; ◼ Support rich motor control diagnostic and protection: OV, UV, OC, OT, stall and phase loss and so on; ◼ Provide S32DS IDE and IAR for ARM IDE projects, support U-Multilink and J-LINK debugger; We have several S32K142-ECC RDB in stock, if you have the project and need the RDB for evaluation, please contact your local NXP or NXP dist FAE, Sales and Marketing. For technique support, contact raymond.tang@nxp.com  thanks, Best regards, Raymond
記事全体を表示
******************************************************************************** * Detailed Description: * * This example shows how to use the back-to-back mode of the PDB to trigger * sequence of ADC channels conversion. 4 PDB channel 0 pre-triggers/triggers are * generated upon single PDB SW trigger. The first trigger is started by the PDB, * no delay is used. Next 3 triggers start after corresponding acknowledgment is * received from ADC0. * * Converted data is used to change color of the EVB led based on Trimmer position. * * ------------------------------------------------------------------------------ * Test HW:         FRDM-S32K144 * MCU:             PS32K144HFVLL 0N77P * Fsys:            default * Debugger:        S32DS * Target:          internal_FLASH * ********************************************************************************
記事全体を表示
Hi,    Firstly, you should get the flash block size of your S32K3xx. Table in RM could be the reference.    Secondly, you should know that there are super sector and sector in S32K3xx.   Sector                    Subdivision of the Flash Block that is independently erasable. Sector Size is always 8 KB. Super sector          Subdivision of the flash block that includes a group of sectors. Super Sector Size is always 64 KB, and consists of 8 sectors.    Thirdly, based on the information of PFCBLKx_SSPELOCK in RM, you can calculate the numbers of super sector and sector in each flash block.   For example in S32K312, it has 2MB flash totally and each block is 1MB. So, in each 1MB, its first 768KB is with super sector granularity. The numbers of super sector is 768/64=12; the followed sector number is 256/8=32. Cheers! Oliver
記事全体を表示
Some customers inquire about the FreeMASTER JumpStart Project mentioned in the Get Started with the S32K1xxEVB. So here to talk about the problems you may encounter and how to solve them. Where to download FreeMASTER JumpStart Project Customers may not find where to download FreeMASTER JumpStart Project at the moment. It should be downloaded from the Embedded Software under Design Resources of the development board. But the download link of S32K142EVB \ S32K144EVB \ S32K146EVB is missing. We can search the keywords “* JumpStart” at www.nxp.com download embedded application software and PC host application software that you need. Which version of S32 Design Studio should be used The readme file will tell us which version of S32 Design Studio the project was created. For example: the readme in the S32K144_EVB_JumpStart_Firmware package shows that the project for S32K14x EVB JumpStart SW was created in S32 Design Studio for ARM v2.0. Which version of SDK should be used You may get the Validation of S32K144_EVB_JumpStart_Firmware Kinetis SDK project when import the project : The project S32K144_EVB_JumpStart_Firmware was created for Kinetis SDK SDK_S32K14x_08 which is not installed in this product (repository SDK_S32K14x_08 not found).  The chapter Version Tracking of S32SDK_for_S32K1xx_RTM_3.0.3_ReleaseNotes shows that the SDK_S32K14x_08 means EAR 0.8.5. By default only S32 SDK EAR 0.8.4 is installed in S32DS for ARM 2.0, so we need to update the S32 Design Studio for Arm® v2.0 Update 2 – S32 SDK 0.8.5 EAR & MQX by refer S32 Design Studio for Arm v2.0 - Update 2 available Incorrect UART baud rate setting The baud rate selected for LPUART in Processor Expert is 600 by default, which does not match the description in the readme file. 600 is not in the FreeMASTER serial port baud rate support list, so let us reconfigure the baud rate to 115200 and then click Generate Processor Expert Code. When connect S32K144EVB with FreeMASTER by UART, you can see that the Baud rate 300 is not in the support list. This is the reason why using the default configuration of S32K144_EVB_JumpStart_Firmware is not able to connect with FreeMASTER.       
記事全体を表示
******************************************************************************** * Detailed Description: * * FlexIO module is configured for UART RX and TX function. * Timer 0 and Shifter 0 is used for UART TX function. * Timer 1 and Shifter 1 is used for UART RX function. * Timer 2 is used for idle detection. * Baud rate = 115200 * HW connection: PTA0 - TX, PTA1 - RX, PTA7 is used to signalize idle detection. * Connect PTA0 and PTA1 to create external loopback for this test. * ------------------------------------------------------------------------------ * Test HW: S32K144EVB * MCU: FS32K144HAMLL 0N57U * Fsys: 80MHz * Debugger: Lauterbach Trace32 * Target: internal_FLASH ********************************************************************************
記事全体を表示
Some customers inquire how to use FreeMASTER with S32K3. But there is no exists example projects which demonstrate usage of the FreeMASTER serial communication driver in S32K3 Real Time Drivers at the moment. So this article will introduce how to use FreeMaster SDKs in S32K3 RTD 0.9.0. Download S32DS \ S32K3 Development Package \ RTD (SDK) \ FreeMASTER Driver Login your account on NXP website, and download the S32K3 Standard software from TOOLS &SOFTWARE of S32K3 webpage. If you have already installed the S32DS3.4 \ S32K3 Development Package 3.4.0 \ RTD 0.9.0, then you can skip the following part and start directly from 4.Install FreeMASTER Driver 3.0 for S32K3 Install S32K3 Development Package 3.4.0 After install the S32 Design Studio v3.4, we should install S32K3 Development Package 3.4.0(SW32K3_S32DS_3.4.0_D2012.zip): go to menu "Help" -> "Install New Software" and click on "Add..." button Here we uncheck S32 Design Studio S32K3 SDK (RTD S32K3 0.8.1), because we will install the newer version S32K3 RTD 0.9.0 later. Install S32K3 Real Time Drivers Version 0.9.0 S32K3 Real Time Drivers Version 0.9.0 can be installed by refer the Offline Package Installation Setup of S32DS Extensions & Updates: Explanation and How To Use. Install FreeMASTER Driver 3.0 for S32K3 Attach FreeMASTER_S32K3 to S32K344_UART_Printf_Sample_090_34 The reason for choosing the S32K344_UART_Printf_Sample_090_34 project to demonstrate the combination of FreeMaster SDKs is that the project has already configured the LPUART of the S32K3X4EVB-Q257 development board. Select LPUART peripheral as host communication Through the description in the Requirements and Release Description chapter of FreeMASTER Driver Release Notes(FMSTRS32K3RN), we can see that currently only UART interface is supported. The S32K3 FreeMASTER 3.0 version 1.0.0 only support NXP GCC 6.3 or 9.2 for ARM at the moment, but the latest S32K3 Real Time Drivers Version 1.0.0 is based on NXP GCC 10.2.0. This is the reason why RTD 0.9.0 is selected in this article.  The README.txt also shows that: Current package provides FreeMASTER Communication Driver support for S32K344 over LPUART module   LPUART13 is selected in this project for S32K3X4EVB-Q257, so we need to define the base address for FreeMASTER: #define FMSTR_LPUART_BASE           0x404A0000 Modify the main function according to the README.txt: Connect FreeMASTER3.1 to S32K3X4EVB-Q257 board Here we can see that the FreeMASTER3.1 is connected to S32K3X4EVB-Q257 board.  
記事全体を表示
*All of the source code placed is for example use only. Document listed is only for your information only. NXP does not accept liability for use of this code or document in the user’s application. Map: https://bra.in/3vGE9q Resource: My Brain (thebrain.com) Links Community relative for S32K S32K S32DS: S32 Design Studio S32K SDK: S32 SDK S32K Safety: SafeAssure NDA Model-based Design: NXP Model-Based Design Tools Documentation Reference Manual Rev12.1 Data Sheet Rev12 Hardware Design Guide: AN5426, Hardware Design Guidelines for S32K1xx Microcontrollers  (REV 4)  Errata Application Note Tool & Software Design & Solution  S32DS IDE for ARM S32k1: S32 Design Studio IDE for Arm® based MCUs | NXP   S32SDK for ARM S32K1: Automotive S32 SDK for Arm® devices | NXP  Embedded Software Unified Bootloader Framework Unified bootloader stack based on UDS and CAN/LIN TP protocol. AUTOSAR MCAL Tips/FAQ  Safety Process to apply access to Safety Docs and Support: Functional Safety documents AVAILABLE | Require access to the SafeAssure NDA group S32K Safety Enablement: https://community.nxp.com/t5/S32K/S32K-safety-documents-and-demo-code-with-SDK/m-p/1156735#M8231 Hard Fault Fault handling on S32K144  AN12522, S32K1xx ECC Error Handling – Application note  (REV 0) S32K1xx系列MCU的常见内核异常(Fault Exception)及处理详解(以S32K144为例介绍) [FAQ] AUTOSAR MCAL   Where can I find compiler and compiler option info for specific MCAL package? Can I use different compiler version or compiler options for specific MCAL package? Where can I download MCAL package? How to get latest MCAL HF version from your NXP website account if you have already registered and applied MCAL SW package. What does HF(Hot Fix) mean? Can we use it for production? How to calculate current (power consumption) of S32K? S32K Power Estimation Tool (PET) released Enwei Hu 公众号 "汽车电子expert成长之路"原创: 历史文章分类列表目录(点击文章标题直接跳转,截止2020年4月20日)  1. 汽车电子ECU bootloader开发系列 汽车电子ECU bootloader开发要点详解 汽车电子ECU bootloader开发之S32K1xx系列MCU NVM驱动独立安全bootloader开发详解 S32K1xx ECU bootloader开发之RAM NVM驱动(S19文件)生成与集成调用和测试详解 汽车电子ECU bootloader开发之S32K144的CAN bootloader开发详解(工程源代码开源供大家参考) 汽车电子ECU bootloader开发开发之S32K1xx系列MCU bootloader开发要点详解 汽车电子ECU BootLoader开发之基于CAN总线通信的MPC574xP系列MCU bootloader开发详解 汽车电子ECU BootLoader开发之基于CAN总线通信的S12(X) 系列MCU独立NVM驱动安全bootloader  浅谈嵌入式软件开发之Qorivva MPC57xx和S32R系列多核MCU启动配置与bootloader开发要点详解 Qorivva MPC56xx系列MCU启动过程全解析(基于CW IDE应用工程--EAB I、链接文件、启动文件和map文件) 浅谈嵌入式MCU软件开发之startup过程详解(从复位向量到main函数之前的准备工作) 浅谈嵌入式MCU软件开发之S32K1xx系列MCU启动过程及重映射代码到RAM中运行方法详解 CodeWarrior IDE使用Tips之利用prm链接文件实现储存器数据填充和代码编译结果CRC校验和自动生成详解 汽车电子ECU BootLoader开发系列相关文章链接与资源汇总; 2. 浅谈嵌入式MCU软硬件开发系列 浅谈嵌入式MCU开发中的三个常见误区 浅谈嵌入式 MCU 软件开发之应用工程的堆与栈 浅谈嵌入式MCU软件开发之中断优先级与中断嵌套 浅谈嵌入式MCU软件开发之代码风格与代码优化 深入浅出谈嵌入式MCU 内核之ARM Cortex-M系列CPU内核功能特性概述与对比(强烈推荐!!!) 浅谈嵌入式MCU软件开发之内存分配详解--链接文件与map文件中段的分配使用和使用注意事项 浅谈嵌入式MCU硬件设计之MCU最小系统电路 浅谈嵌入式MCU软件开发之startup过程详解(从复位向量到main函数之前的准备工作) 浅谈嵌入式MCU软件开发之S32K1xx系列MCU启动过程及重映射代码到RAM中运行方法详解 浅谈嵌入式MCU软件开发之S32K1xx系列MCU CPU内核性能优化方法详解 浅谈嵌入式软件开发之Qorivva MPC57xx和S32R系列多核MCU启动配置与bootloader开发要点详解 浅谈嵌入式系统软件开发之S32K1xx系列MCU的MPU配置与使用详解 浅谈嵌入式软件开发之MagniV S12Z系列MCU内核Machine Exception异常原理与恢复 浅谈嵌入式软件开发之重定向标准输入输出设备使用printf()函数格式化输出调试信息(基于S32DS IDE和MPC5744P) 浅谈嵌入式MCU软件开发之startup过程详解(在CodeWarrior 5.1 中实现RAM自定义初始化) 嵌入式软件开发之S12(X)系列MCU的far和near函数指针调用详解(S12G128 CW 5.x Project) 浅谈嵌入式MCU软件开发之S12(X)系列MCU 中断ISR在CodeWarrior 5.1 IDE 中的三种写法 浅谈嵌入式软件开发之Qorivva MPC56/57xx系列MCU的Power e200内核寄存器功能和内核调试技巧介绍 嵌入式软件开发之调试器(Debugger)使用--PEMicro Multilink功能介绍与使用FAQ 浅谈嵌入式MCU软件开发之MCU芯片内部Bandgap参考电压(带隙基准)和集成温度传感器的工作原理和使用详解 浅谈嵌入式MCU软件开发之条件断点的设置与使用详解(以S32DS IDE + U-Multink debugger为例介绍) 浅谈嵌入式软件开发之使用Srecord工具实现S19文件数据填充和CRC校验和自动计算与存储方法详解 浅谈嵌入式MCU软件开发之使用makefile脚本编译和调试NXP S32 SDK应用工程详解 3. 外设使用Tips系列 S32K1xx系列MCU使用Tips之SDK软件架构和使用详解 S12(X)系列MCU的片上存储器资源与分页访问机制详解(一) S12(X)系列MCU的片上存储器资源与分页访问机制详解(二) S12(X)系列MCU的加密(Secure)原理和解密(Unsecure)方法 Qorivva MPC56xx系列MCU的Flash加密解密原理与工程实现方法详解 使用 Cyclone 离线编程器对 S12(X)和 MagniV S12Z 系列 MCU 片上 NVM 编程  S32K1xx系列MCU使用Tips--功能介绍及软件开发和硬件设计FAQ  S32K1xx系列MCU使用Tips--Flash加密后不断复位无法连接调试器的问题解决 S32K14x系列MCU使用Tips之硬件FPU特性介绍和使用详解 外设使用Tips之Qorivva MPC56xx_57xx系列MCU内核异常(IVORx)与IRQ中断处理详解 外设使用Tips之Qorivva MPC56xx/57xx系列MCU的模式控制与切换(片上外设资源使能与功耗控制) 外设使用Tips之MCU内部集成IRC时钟工作原理、特性和trim原理及方法详解(以KEA系列MCU的ICS为例) 外设使用Tips之S12G系列MCU Startup之前的复位过程详解(COP看门狗复位和时钟监测复位中断识别与处理)  外设使用Tips之MPC57xx系列MCU C55 Flash模块详解及其SSD(标准软件驱动)使用 外设使用Tips之MSCAN接收ID滤波器设置 外设使用Tips之TIM定时器使用FAQ和使用经验 外设使用Tips之MPC574xP系列汽车级MCU的SWT看门狗定时器配置与使用 NXP汽车MCU开发详解之KEA系列汽车MCU开发指南 S32K1xx系列MCU应用指南之芯片锁死(lockup)复位原因分析与恢复方法详解 关于使用J-LINK开发S32K1xx系列MCU应用程序的使用说明和注意事项 NXP S12G_XE系列汽车MCU软件开发指南 资料分享--S12XE 系列MCU XGATE协处理器开发常见问题(Q&A) S32K1xx系列MCU应用指南之相同封装不同型号(part number)间相互替换的软件与硬件设计注意事项 4. S32K SDK使用详解系列 S32K SDK使用详解之S32 SDK软件编程思想详解 S32K SDK使用详解之S32 SDK软件架构详解 S32K SDK使用详解之Keil MDK开发S32K1xx系列MCU应用程序(使用Processor Expert配置SDK) S32K SDK使用详解之GHS Multi(Eclipse插件)开发S32K1xx系列MCU应用程序(使用PE配置SDK) 浅谈嵌入式MCU软件开发之使用makefile脚本编译和调试NXP S32 SDK应用工程详解 浅谈嵌入式MCU软件开发之S32K1xx系列MCU CPU内核性能优化方法详解 S32DS GNU GCC编译优化选项与配置方法详解及S32 SDK代码编译优化选项设置建议 S32K系列MCU应用开发详解直播ppt高清pdf版本下载与直播视频回放链接 S32DS使用Tips--SDK使用常见问题(FAQ)答疑 S32K SDK使用详解之interrupt_manager组件配置与使用详解 S32K SDK使用详解之Flash驱动组件使用(FTFC Flash控制器功能详解与使用FAQ & Tips) S32K SDK使用详解之PinSettings组件配置与使用详解(S32K1xx PORT 和GPIO模块) 5. S32K1xx应用指南系列 S32K1xx系列MCU的常见内核异常(Fault Exception)及处理详解(以S32K144为例介绍) S32K1xx系列MCU应用指南之芯片锁死(lockup)复位原因分析与恢复方法详解 S32K1xx系列MCU的EEE(Emulated EEPROM)使用详解 S32K1xx系列MCU应用指南之FlexIO和CSEc硬件加密模块的使用详解 S32K1xx系列MCU应用指南之WDOG看门狗模块使用详解 S32K1xx系列MCU应用指南之存储器ECC功能使用详解(一) S32K1xx系列MCU应用指南之存储器ECC功能使用详解(二) S32K1xx系列MCU应用指南之RTC模块使用详解 S32K1xx系列MCU应用开发指南之IAR toolchain样例工程及使用常见问题(FAQ) S32K1xx系列MCU的低功耗实现要点详解(基于S32K144 EVB-Q100x Rev C测试) 6. 细说汽车电子通信总线系列 细说汽车电子通信总线之CAN 2.0 总线协议详解 细说汽车电子通信总线之CAN-FD 总线协议详解 细说汽车电子通信总线之LIN总线协议详解 细说汽车电子通信总线之常见汽车电子串行通信总线(CAN、LIN、DSI、ISO-9141、SWCAN、J 1850)对比 7. S32DS IDE使用Tips系列 S32DS使用Tips--S32DS for Power V1.2 链接文件和启动过程详解 S32K1xx系列MCU使用Tips之SDK软件架构和使用详解 S32DS GNU GCC编译优化选项与配置方法详解及S32 SDK代码编译优化选项设置建议 S32DS IDE使用Tips--应用程序开发实战实用技巧总结与详解(工欲善其事必先利其器) S32DS使用Tips--SDK使用常见问题(FAQ)答疑 S32DS IDE使用Tips--应用工程调试常见问题(FAQ)答疑 S32DS IDE使用Tips之Classic CW(2.10)和EclipseCW(10.x和11.x)应用工程移植指南 S32DS 使用Tips之S32DS for Power不同版本之间的GNU工具链差异与外设寄存器位域访问问题总结 S32DS使用Tips之S32DS for Power v1.1应用工程升级到v1.2重新编译运行程序跑飞问题解决 S32DS 使用tips--S32DS for ARM v1.3工程到S32DS for ARM V2.0迁移升级方法和注意事项 S32DS 使用 tips--工程属性配置(编译选项和C编译器、汇编器及链接器设置) S32DS使用Tips--如何编译生成和调用静态库 S32DS使用Tips--如何通过创建新的编译目标(Build Target)在同一个S32DS工程中同时编译静态库和应用程序 S32DS使用Tips--如何配置和使能Attach功能定位软件程序bug和完成bootloader与应用程序工程的联合调试 CodeWarrior与S32DS IDE使用 Tips之如何在应用工程中保留定义但未使用的全局常量、变量(用于参数标定) S32DS 使用 tips--使用Flash from file下载S19或elf文件 S32DS for ARM v2018.R1安装IAR Eclipse插件调用IAR工具链开发S32K系列MCU应用程序详解 浅谈嵌入式MCU软件开发之条件断点的设置与使用详解(以S32DS IDE + U-Multink debugger为例介绍) S32DS IDE使用Tips之配置objcopy选项生成S3行的S19文件和指定每行S19文件的最大数据长度的方法和步骤详解 8. CodeWarrior IDE使用Tips系列 CodeWarrior IDE使用tips之bug定位绝技--hotsync与attach调试 CodeWarrior IDE使用Tips之Qorivva MPC56xx新建应用工程选项、调试高级选项及下载过程控脚本详解 CodeWarrior IDE使用tips之prm链接文件详解(自定义存储器分区以及自定义RAM数据初始化与在RAM中运行函数) CodeWarrior IDE使用Tips-Qorivva MPC56xx应用工程map文件全解析(CW 2.10/10.x ) CodeWarrior IDE使用tips之map文件详解 CodeWarrior IDE 版本选择与 License功能(feature)和价格,授权形式差异、激活方法与安装使用 答疑解惑之Win10操作系统中CodeWarrior IDE USB dongle  license安装问题解决方法详解 CodeWarrior IDE使用Tips之利用Hiwave读取S12(X)系列MCU片上NVM命令脚本(CW 5.x IDE) CodeWarrior IDE使用Tips-如何编译生成和调用静态库 CodeWarrior与S32DS IDE使用 Tips之如何在应用工程中保留定义但未使用的全局常量、变量(用于参数标定) CodeWarrior IDE使用Tips之如何通过prm文件指定汇编代码函数、全局变量和常量的储存地址 CodeWarrior IDE使用Tips之利用prm链接文件实现储存器数据填充和代码编译结果CRC校验和自动生成详解 CodeWarrior IDE使用Tips之burner工具使用详解(实现不同类型存储器地址间的转换和NVM编程格式文件的输出) CodeWarrior IDE使用Tips--使用burner将elf文件转换生成HEX和BIN文件的方法和步骤详解 CodeWarrior IDE使用Tips之利用Hiwave读取S12(X)系列MCU片上NVM命令脚本(CW 5.x IDE) S32DS IDE使用Tips之Classic CW(2.10)和EclipseCW(10.x和11.x)应用工程移植指南 9.   汽车ECU参数标定系列 汽车ECU参数标定之配置e200系列CPU内核MMU实现Qorivva MPC56xx_57xx系列MCU的参数在线实时标定 汽车ECU参数标定之配置Overlay RAM实现Qorivva MPC57xx系列MCU参数在线标定和代码重映射原理和方法详解 CodeWarrior IDE使用Tips之如何通过prm文件指定汇编代码函数、全局变量和常量的储存地址 CodeWarrior与S32DS IDE使用 Tips之如何在应用工程中保留定义但未使用的全局常量、变量(用于参数标定) CodeWarrior IDE使用tips之prm链接文件详解(自定义存储器分区以及自定义RAM数据初始化与在RAM中运行函数) CodeWarrior IDE使用tips之map文件详解 S32DS使用Tips--S32DS for Power V1.2 链接文件和启动过程详解 10.  工欲善其事必先利其器系列 工欲善其事必先利其器之NXP汽车MCU系列产品家族(Family)功能特性及应用介绍 工欲善其事必先利其器之NXP汽车MCU开发资料和开发软件获取与使用指南 11.  答疑解惑系列 疑难答疑之S12G系列MCU使用Hiwave和BDM调试器debug时无法使用逻辑地址查看和保存P-flash问题的解决 疑难答疑之S32DS IDE调试启动过程详解与调试目标复位方法和步骤详解 答疑解惑之S12(X)系列MCU的CodeWarrior 5.x应用工程下载调试过程详解以及如何保护NVM存储器不被擦除 答疑解惑之Win10操作系统中CodeWarrior IDE USB dongle  license安装问题解决方法详解 12. 产线批量Flash编程与ESD/EOS保护系列 使用 Cyclone 离线编程器对 S12(X)和 MagniV S12Z 系列 MCU 片上 NVM 编程 使用Cyclone 离线编程器对S32K1系列MCU进行NVM(P-Flash, D-Flash和EEE)编程的方法与步骤详解 13.  其他 汽车电子expert成长之路微信公众号原创技术分享文章全集-2019年度精编版 汽车电子expert成长之路微信公众号原创技术分享文章集合2017~2018年 最新最全的NXP Techday和Connect(原Freescale FTF)技术培训资料下载链接 汽车以太网(100BASE-T1)转工业以太网(100BASE-TX)转换器工作原理介绍 使用关键词回复功能找到感兴趣的公众号原创技术文章    
記事全体を表示
The S32K14x MCU ARM Cortex M4F core processor handles fault exceptions using four handlers.   Handlers UsageFault_Handler() Usage faults are caused by an application that incorrectly uses Cortex M4 processor trying to execute an undefined instruction execute an instruction that makes illegal use of the Execution Program Status Register (EPSR), typically, this processor support only Thumb instruction set and it requires that all branch targets should be indicated as odd numbers, having bit[0] set. perform an illegal load of EXC_RETURN to the PC access a coprocessor if the access is denied or privileged only (configurable in CPACR) make an unaligned memory access execute an SDIV or UDIV instruction with a divisor of 0   The detection of the division by zero fault is disabled by default which means that such an operation returns zero and the fault is not detected. Similarly, the Cortex-M4 processor supports unaligned access for certain instructions. The detection on both the division by zero and the unaligned access (for every instruction) faults can be enabled in Configuration and Control Register (CCR).   BusFault_Handler() Bus faults occur when a bus slave returns an error response while stacking for an exception entry unstacking for an exception return prefetching an instruction during floating-point lazy state preservation Beside these faults listed above, there are also bus faults labeled as Precise and Imprecise. Imprecise bus fault occurs when an application writes to buffered memory region and continues executing subsequent instructions before the actual bus fault is detected. Therefore, at the time the exception rises the program counter doesn’t point to the instruction that has caused the bus fault. For debugging purposes, it is necessary to have “precise” program counter value to know which instruction has caused the fault exception. Imprecise bus fault can be forced to be precise by disabling the write buffer in (ACTLR_DISDEFWBUF = 1). This however might decrease the performance.   Note: The S32K144 MCU has its own system Memory Protection Unit which is implemented on the bus. Therefore, any system MPU violation triggers bus faults.   MemManage_Handler() Typically, these exceptions rise on an attempt to access regions that are protected by the core ARM Cortex M4 Memory Protection Unit. attempt to load or store at a protected location instruction fetch from a protected location stacking/unstacking fault caused by violation of the memory protection protection violation during floating-point lazy state preservation   S32K1xx series implements its own system Memory Protection Unit on the bus and therefore an attempt to access a protected region results in a bus fault exception instead. Nevertheless, the system MPU does not protect access to peripheral registers, and as the attached example code shows, an attempt to fetch instruction from a peripheral memory region causes a MemManage fault exception.   HardFault_Handler() This handler is the only one that has a fixed priority (-1) and is always enabled. If other handlers are disabled (in the SHCSR register), all faults are escalated to this handler. The escalation take place also when a fault occurs during another fault handling execution or while the vector table is read.   Priority of exception fault handlers   The fault exception handlers’ priorities, besides the HardFault handler (fixed priority -1), are configurable in fields PRI_4, PRI_5 and PRI_6 of SHPR1 register. These fields are byte-accessible and Cortex M4 support 255 priority levels, however, S32K14x MCUs support 16 priority levels only. Therefore, priorities are configurable in the four most significant bits of PRI_4, PRI_5 and PRI_6 only, which is similar to other NVIC IPR registers as shown below.   The lower priority number is set, the higher priority. By default, all handlers have priority set to zero.   Status and address registers for fault exceptions Configurable Fault Status Register (CSFR) consists from three status bit fields for Usage Fault (UFSR), Bus Fault (BFSR), and Memory Management Fault (MMFSR) where each bit represents a fault exception.     There are also two auxiliary address registers. If BFARVALID is set in the BFSR register, Bus Fault Address Register (BFAR) holds the memory access location of a precise bus fault. Similarly, if MMARVALID bit is set in MMFSR register, Memory Manage Address Register (MMAR) holds the address of a MemManage fault.   Example code To demonstrate the debugging process, the following exceptions can be forced: attempt to access an unimplemented memory area attempt to write to a non-gated peripheral register write to read only register fetching an instruction from a protected peripheral memory region division be zero unaligned memory access execution of a non-thumb instruction execution of an undefined instruction   When the program enters an exception handler, the stack frame is pushed onto the stack including the program counter value of the fault instruction. In this example, the exception handlers are declared with __attribute__((nake_)) (fault_exceptions.h), no prologue is generated and the program counter is always offset by 6 words (0x14) from the stack pointer that can be read in the handlers using either the debugger (memory view) or a SW pointer. If an application uses Process Stack Pointer (PSP) as well, it is necessary to find out whether the stack pointer comes from Main Stack Pointer (MSP) or PSP, this information is available in the EXC_RETURN value in the link register. Having a precise program counter address, we can find the fault instruction in Disassembly. This applies to all exception except for imprecise bus faults as explained above, imprecise bus faults can be forced to be precise by disabling the Write buffer.   The CSFR register is read to determine which exception has occurred and, if available, the memory access location that has caused the exception.    References Cortex-M4 Devices Generic User Guide Cortex-M4 Technical Reference Manual
記事全体を表示