S32K知识库

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

S32K Knowledge Base

标签

讨论

排序依据:
This example project will show user how to use and configure the basic functionalities of ICU (WKPU) + DIO (GPIO).   ------------------------------------------------------------------------------ * Test HW: S32K396-BGA-DC1 (SCH-55517 Rev B2) * MCU: S32K396 * IDE: S32DS3.5 & S32DS v3.6.x * SDK release: RTD 6.0.0 * Debugger: PEMicro * Target: internal_FLASH  ------------------------------------------------------------------------------ This example routine configures the WKPU unit for a GPIO interrupt wake-up. This is the simplest WKPU example. Pin PTB19 (WKPU42) is configured for wake-up.  The routine waits for SW8 to be pressed, then turns off LED1, and: Switches core clock to FIRC (Mode C Boot default from Table 125.). Initializes the WKPU instance. Configures WKPU42 (SW4). Enters standby (or fast standby). After pressing SW4, MCU wakes up, resets and polls for SW8 to be pressed again. If FAST_STANDBY is selected, Wkup_FastWkupBootAddress() is entered and both LED2 & LED3 blink before jumping to reset handler for full initialization. This example is provided as is with no guarantees and no support.
查看全文
This example project will show user how to use and configure the basic functionalities of WKPU + RTC API.  ------------------------------------------------------------------------------ * Test HW: S32K3X4EVB-T172 (SCH-53148 REV B2) * MCU: S32K344 * IDE: S32DS3.5 & S32DS3.6 * SDK release: RTD 6.0.0 * Debugger: PE Micro * Target: internal_FLASH  ------------------------------------------------------------------------------ This example routine configures the WKPU & RTC units for wake-up. The RTC is present in always ON domain, hence available in RUN mode as well as in STANDBY mode. Snag_120dece.png The chip contains one instance of RTC (Real Time Clock) timer and API (Autonomous Periodic Interrupt) timer, where both can perform 32-bit comparisons. Both RTC and API timers can generate interrupts as well as wake-up from low power modes. The following figure highlights the path for RTC API wake-up. Please refer to Chapter 69.3.2 API functional description from the S32K3XX reference manual (Rev. 12) for further information. Julin_AragnM_0-1768424703841.png The routine waits for SW5 to be pressed, then turns off the green LED, and enters Wkpu_EnterStandby() function which: Switches CORE_CLK to FIRC. Initializes the WKPU instance. Configures WKPU2 & WKPU42 (PTB19). Initializes and enables interrupt for RTC. Enables RTC API and loads the APIVAL to 3000ms.  Starts timer. Enters standby (or fast standby). After the period defined, RTC API generates an interruption and MCU wakes up. After wake-up, MCU resets and polls for SW5 to be pressed again. The RTC API value can be changed with RTC_PERIOD_DELAY_MS(x) macro defined in Wkpu.h. This example is provided as is with no guarantees and no support.
查看全文
**************************************************************************************************** * Detailed Description: * This example uses BIST and EMCEM drivers from SPD 1.0.6. * BIST and EMCEM can be enabled or disabled using macros. * * BIST runs immediately after a power-on reset and triggers an ST_DONE reset. * EMCEM initialization is only possible after a system reset without an attached debugger. * Therefore, wait loops (controlled by macros) are used to manage execution flow * for both BIST and EMCEM. * * Fault injection is selected via macros: * - FAULT_EMCEM_DCM_NCF_1_AD_EDC_ERR_OUT → handled via NMI * - FAULT_EMCEM_DCM_NCF_2_PRAM1_MULTI_ERR → handled via BusFault (if INJECT_EIM) and FCCU alarm * - FAULT_EMCEM_DCM_NCF_2_ITCM_MULTI_ERR → handled via BusFault (if INJECT_EIM) and FCCU alarm * - FAULT_EMCEM_DCM_NCF_3_PFO_CODE_ERR → FCCU alarm → (if TIMEOUT_PFO_CODE_ERR) → NMI * - FAULT_EMCEM_DCM_NCF_5_STCU_NCF → handled via FCCU alarm * - FAULT_EMCEM_DCM_NCF_7_SW_NCF_0 → FOSU Destructive reset * (read resetReason after reset, MCU_FCCU_FTR_RESET). * FOSU triggers as no FCCU reaction is configured for NCF_7 * while FCCU is enabled and reactions are configured for other faults. * * ------------------------------------------------------------------------------------------------ * MCU: S32K3x4EVB-Q257 * Fsys: 160 MHz PLL with 16 MHz crystal reference * Debugger: Lauterbach Trace32, S32DS IDE 3.6.5 * Target: internal_FLASH ****************************************************************************************************
查看全文
* Detailed Description: * Updated the example lwip_FreeRTOS_s32K344 to enable pinging the lwIP stack from the command window * *ping 192.168.0.209 * *Pinging 192.168.0.209 with 32 bytes of data: *Reply from 192.168.0.209: bytes=32 time=2ms TTL=255 *Reply from 192.168.0.209: bytes=32 time=1ms TTL=255 *Reply from 192.168.0.209: bytes=32 time=1ms TTL=255 *Reply from 192.168.0.209: bytes=32 time=1ms TTL=255 * *Ping statistics for 192.168.0.209: * Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), *Approximate round trip times in milli-seconds: * Minimum = 1ms, Maximum = 2ms, Average = 1ms * * * EVB: * - All jumpers in default positions. * * Configuration: * - Updated pin configuration * - Modified FXOSC, PLLAUX + dividers * - Platform: added EMAC_0_IRQn interrupt * - IP address set to 192.168.0.209 and enabled UDP_ECHO, etc. * - Added DIO * * main.c * - Updated only the header * device.c * - No updates * test.c * - Commented out the code that shuts down the TCP/IP stack after its predefined timeout * - Added LED task * * ------------------------------------------------------------------------------------------------ * Test HW: MR-CANHUBK344 * MCU: S32K344 * Debugger: Lauterbach Trace32 * Target: internal_FLASH * EVB connection: EMAC <-> RDDRONE-T1ADAPT <-> USB-to-Ethernet adapter <-> Laptop DELL, Windows 11
查看全文
* Detailed Description: * Updated the example lwip_FreeRTOS_s32K388 to enable pinging the lwIP stack * from the command window * *ping 192.168.0.209 * *Pinging 192.168.0.209 with 32 bytes of data: *Reply from 192.168.0.209: bytes=32 time=2ms TTL=255 *Reply from 192.168.0.209: bytes=32 time=1ms TTL=255 *Reply from 192.168.0.209: bytes=32 time=1ms TTL=255 *Reply from 192.168.0.209: bytes=32 time=1ms TTL=255 * *Ping statistics for 192.168.0.209: * Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), *Approximate round trip times in milli-seconds: * Minimum = 1ms, Maximum = 2ms, Average = 1ms * * * EVB: * - All jumpers in default positions except: jumper J361 must be closed. * - Soldering rework required to connect an external debugger. * See S32K388EVB-Q289_HW_User Manual_A3.pdf, chapter 15 (Errata). * * Configuration: * - Updated pin configuration * - Modified PLLAUX + dividers * - Updated GMACx clocks * - Platform: added GMAC0 interrupts * - IP address set to 192.168.0.209 and enabled UDP_ECHO, etc. * - Eth_43_GMAC: configured for RGMII 1G, EthIndex = 0 * - Added DIO * * main.c * - Updated only the header * device.c * - Added RTD workaround for DCMRWF* registers * (copied from example S32K388_gptp_ds, S32K3xx gPTP Stack 1.0.0) * test.c * - Commented out the code that shuts down the TCP/IP stack after its predefined timeout * - Added LED task * * --------------------------------------------------------------------------------------- * Test HW: S32K388EVB-Q289 SCH-88925 REV A, 700-88925 REV X1 * MCU: S32K388 * Debugger: Lauterbach Trace32 * Target: internal_FLASH * EVB connection: GMAC0 <-> Media converter TE-1402 (1G, Follower) <-> USB-to-Ethernet adapter <-> Laptop DELL, Windows 11
查看全文
**************************************************************************************************** * Detailed Description:   * * The Flexio I2C driver provides an optional configuration parameter for reducing the number of DMA interrupts * required for transmission that are configured with DMA Optimize option. Instead of being interrupted after each * end of transmitting or receiving a data block or data amount larger than 13 bytes, only one interrupt will be raised to * stop frame and inform to user that the transmission was done. * * More details can be found in "RTD_I2C_UM.pdf", the chapter 3.6.3 FLEXIO DMA Optimize. * ------------------------------------------------------------------------------------------------ * Test HW: S32K3x4EVB-T172 SCH-53148 REV B2 * MCU: S32K344_172HDQFP * IDE: S32DS 3.6.0 * RTD release: S32K3_S32M27x Real-Time Drivers ASR R21-11 Version 6.0.0 * Debugger: Lauterbach, P&Emicro * Target: Internal_FLASH * Connections: * FXIO_D10_SCL (J4.19) - LPI2C1_SCL (J3.24) * FXIO_D11_SDA (J4.17) - LPI2C1_SDA (J3.27) ***************************************************************************************************/ Test Result: image.png  
查看全文
******************************************************************************************** * Test HW: S32K312 EVB-Q172 * MCU: S32K312 * Compiler: S32DS3.6.2 * SDK release: RTD 6.0.0 QLP04 * Debugger: PE Micro * Target: Internal_FLASH ******************************************************************************************** The objective of this demo application is to generate an interrupt and wakeup using the single GPIO. In this application, USR_SW5 (PTB26) in S32K312_Q172 EVB is used both as an interrupt source in RUN mode and as a wake‑up source from STANDBY mode.   Thanks & regards, Krishnakumar V
查看全文
********************************************************************************* * Detailed Description: * Updated the example lwip_FreeRTOS_s32K389 to enable pinging the lwIP stack * from the command window * *ping 192.168.0.209 * *Pinging 192.168.0.209 with 32 bytes of data: *Reply from 192.168.0.209: bytes=32 time=1ms TTL=255 *Reply from 192.168.0.209: bytes=32 time=1ms TTL=255 *Reply from 192.168.0.209: bytes=32 time=1ms TTL=255 *Reply from 192.168.0.209: bytes=32 time=1ms TTL=255 * *Ping statistics for 192.168.0.209: * Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), *Approximate round trip times in milli-seconds: * Minimum = 1ms, Maximum = 2ms, Average = 1ms * * * EVB: * - All jumpers in default positions, except J848, J822, J1136 - disconnected * to enable an external debugger. * * Configuration: * - Updated pin configuration * - Modified PLLAUX + dividers * - Updated GMAC0 clocks * - Platform: added GMAC0 interrupts * - IP address set to 192.168.0.209 and enabled UDP_ECHO, etc. * - Eth_43_GMAC: configured for RGMII 1G, EthIndex = 0 * - Added DIO * * main.c * - Updated only the header * device.c * - Added RTD workaround for DCMRWF* registers * (copied from example S32K389_gptp_ds, SW32K3xx_M7_gPTP_1.1.0_CD01_D2602) * test.c * - Commented out the code that shuts down the TCP/IP stack after its predefined timeout * - Added LED task * * ----------------------------------------------------------------------------- * Test HW: S32K389EVB-Q437 SCH-94080 REV C, 700-94080 REV A * MCU: S32K389 * Debugger: Lauterbach Trace32 * Target: internal_FLASH * EVB connection: GMAC0 <-> Media converter TE-1402 (1G, Follower) <-> * <-> USB-to-Ethernet adapter <-> Laptop DELL, Windows 11
查看全文
This example project will show user how to use and configure the basic functionalities of WKPU + LPCMP.   ------------------------------------------------------------------------------ * Test HW: S32K3X4EVB-T172 (SCH-53148 REV B2) * MCU: S32K344 * IDE: S32DS3.5 & S32DS3.6 * SDK release: RTD 6.0.0 * Debugger: PE Micro * Target: internal_FLASH  ------------------------------------------------------------------------------ This example routine configures the WKPU & LPCMP units for wake-up. The S32K3XX's LPCMP can operate in trigger mode in both standby and run mode to continuously scan the input channels. RTC-API and LPCMP must be configured before entering into standby mode as per below shown figure: Snag_13de950.png   See chapters 61.1.5 Comparator Trigger Mode & 61.1.6 Interaction with RTC API to cause wakeup from the S32K3XXRM (Rev. 12) for further information.   The register configurations before entering Standby mode for LPCMP trigger mode operation is the following:   Configure RTC.APIVAL to set the period of the round robin operation. Execute standby mode entry. The routine waits for SW5 to be pressed, then turns off the green LED, and enters Wkpu_EnterStandby() function which: Switches CORE_CLK to FIRC. Initializes the WKPU instance. Configures WKPU2 & WKPU42 (PTB19). Initializes and enables interrupt for LPCMP. Initializes RTC and sets the timer value (in RTCC - APIVAL) to 100ms. Starts timer. Enters standby (or fast standby). While in standby, PTA0/1/2 are active; if a voltage higher than 2.5V is detected (ICU LPCMP DAC Voltage Level = 127), or SW6 is pressed MCU will wake-up.  After wake-up, MCU resets and polls for SW5 to be pressed again. The RTC timer value can be changed with RTC_PERIOD_DELAY_MS(x) macro defined in Wkpu.h. This example is provided as is with no guarantees and no support.
查看全文
This example project will show user how to use and configure the basic functionalities of ICU (WKPU) + DIO (GPIO).   ------------------------------------------------------------------------------ * Test HW: S32K3X4EVB-T172 (SCH-53148 REV B2) * MCU: S32K344 * IDE: S32DS3.5 & S32DS v3.6.x * SDK release: RTD 6.0.0 * Debugger: PE Micro * Target: internal_FLASH  ------------------------------------------------------------------------------ This example routine configures the WKPU unit for a GPIO interrupt wake-up. This is the simplest WKPU example. Pin PTB19 (WKPU42) is configured for wake-up.  The routine waits for SW5 to be pressed, then turns off the green LED, and enters Wkpu_EnterStandby() function which: Turns off green LED Switch system clock to FIRC (Option C - Boot Standby mode @24MHz). Initialize the Icu driver. Configures WKPU42 (PTB19). Enters standby. After pressing SW6, MCU wakes up, resets and polls for SW5 to be pressed again. This example is provided as is with no guarantees and no support.
查看全文
* Detailed Description: * Updated the example lwip_FreeRTOS_s32K389 to enable pinging the lwIP stack from the command window * *ping 192.168.0.209 * *Pinging 192.168.0.209 with 32 bytes of data: *Reply from 192.168.0.209: bytes=32 time=1ms TTL=255 *Reply from 192.168.0.209: bytes=32 time=1ms TTL=255 *Reply from 192.168.0.209: bytes=32 time=1ms TTL=255 *Reply from 192.168.0.209: bytes=32 time=1ms TTL=255 * *Ping statistics for 192.168.0.209: * Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), *Approximate round trip times in milli-seconds: * Minimum = 1ms, Maximum = 2ms, Average = 1ms * * * EVB: * - All jumpers in default positions, except J848, J822, J1136 - disconnected to enable an external debugger. * * TJA1103-SDBR: * mode rev-RMII * CONFIG 0,1 1-2 * CONFIG 2,4 2-3 * CONFIG 3 1-2 * * Configuration: * - Updated pin configuration * - IP address set to 192.168.0.209 and enabled UDP_ECHO, etc. * - Eth_43_GMAC: configured for RGMII 1G, EthIndex = 0 * - Added DIO * * main.c * - Updated only the header * test.c * - Commented out the code that shuts down the TCP/IP stack after its predefined timeout * - Added LED task * * ------------------------------------------------------------------------------------------------ * Test HW: S32K389EVB-Q437 SCH-94080 REV C, 700-94080 REV A * MCU: S32K389 * Debugger: Lauterbach Trace32 * Target: internal_FLASH * EVB connection: GMAC1_SABRE <-> TJA1103-SDBR (rev-RMII mode) <-> RDDRONE-T1ADAPT <-> USB-to-Ethernet adapter <-> Laptop DELL, Windows 11
查看全文
/********************************************************************************************** * File main.c * Owner Daniel Martynek * Version 1.0 * Date May-12-2026 * Classification General Business Information ********************************************************************************************** * Detailed Description: * The code enables the data cache, reads a value from DFlash to load it into the cache, * then uses the LMEM interface to inspect and directly overwrite the corresponding cache line. * Finally, it reads the same address again through the CPU, which returns the modified value * from the cache instead of the original data stored in DFlash. * * In this simple setup, where only the data cache is enabled, the code executes from PFlash, * and the accessed data is located in DFlas — the cache line is unlikely to be re-evaluated. * Therefore, the CPU may consistently return the modified value - this behavior is not guaranteed. * ------------------------------------------------------------------------------------- * MCU: S32K142 * Fsys: 48MHz, FIRC * RTD: S32K1_RTD_3_0_0_QLP06_D2603_ASR_REL_4_7_REV_0000_20260320 * Debugger: Lauterbach Trace32 * Target: Internal_FLASH **********************************************************************************************
查看全文
* Detailed Description: * Updated the example lwip_FreeRTOS_s32K358 to enable pinging the lwIP stack from the command window * *ping 192.168.0.209 * *Pinging 192.168.0.209 with 32 bytes of data: *Reply from 192.168.0.209: bytes=32 time=2ms TTL=255 *Reply from 192.168.0.209: bytes=32 time=1ms TTL=255 *Reply from 192.168.0.209: bytes=32 time=1ms TTL=255 *Reply from 192.168.0.209: bytes=32 time=1ms TTL=255 * *Ping statistics for 192.168.0.209: * Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), *Approximate round trip times in milli-seconds: * Minimum = 1ms, Maximum = 2ms, Average = 1ms * * * S32K3X8EVB-Q289: * - All jumpers in default positions except: jumper J685 2-3 * * TJA1120-SDBR: * mode RGMII-ID (both TXC/RXC), Master, Autonomous, XTAL * CONFIG 3 2-3 * CONFIG 5 1-2 * CONFIG 4,6 open * * Configuration: * - Updated pin configuration * - Updated GMAC clocks * - IP address set to 192.168.0.209 and enabled UDP_ECHO, etc. * - Eth_43_GMAC: configured for RGMII 1G * - Added DIO * * main.c * - Updated only the header * * device.c * - Added RTD workaround for DCMRWF* registers * * test.c * - Commented out the code that shuts down the TCP/IP stack after its predefined timeout * - Added LED task * * ------------------------------------------------------------------------------------------------ * Test HW: S32K3X8EVB-Q289 SCH-54870 REV C, 700-54870 REV A * MCU: S32K358 * Debugger: Lauterbach Trace32 * Target: internal_FLASH * EVB connection: SABRE <-> TJA1120-SDBR <-> Media converter TE-1402 (1G, Follower) <-> * USB-to-Ethernet adapter <-> Laptop DELL, Windows 11
查看全文
* Detailed Description: * Updated the example lwip_FreeRTOS_s32K358 to enable pinging the lwIP stack from the command window * *ping 192.168.0.209 * *Pinging 192.168.0.209 with 32 bytes of data: *Reply from 192.168.0.209: bytes=32 time=2ms TTL=255 *Reply from 192.168.0.209: bytes=32 time=1ms TTL=255 *Reply from 192.168.0.209: bytes=32 time=1ms TTL=255 *Reply from 192.168.0.209: bytes=32 time=1ms TTL=255 * *Ping statistics for 192.168.0.209: * Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), *Approximate round trip times in milli-seconds: * Minimum = 1ms, Maximum = 2ms, Average = 1ms * * * S32K3X8EVB-Q289: * - All jumpers in default positions except: jumper J685 2-3 * * TJA1103-SDBR: * mode RGMII-ID (both TXC/RXC) * CONFIG 0,1 1-2 * CONFIG 2,4 2-3 * CONFIG 3 open * * Configuration: * - Updated pin configuration * - Updated GMAC clocks * - IP address set to 192.168.0.209 and enabled UDP_ECHO, etc. * - Eth_43_GMAC: configured for RGMII 100M * - Added DIO * * main.c * - Updated only the header * * device.c * - Added RTD workaround for DCMRWF* registers * * test.c * - Commented out the code that shuts down the TCP/IP stack after its predefined timeout * - Added LED task * * ------------------------------------------------------------------------------------------------ * Test HW: S32K3X8EVB-Q289 SCH-54870 REV C, 700-54870 REV A * MCU: S32K358 * Debugger: Lauterbach Trace32 * Target: internal_FLASH * EVB connection: SABRE <-> TJA1103-SDBR <-> Media converter TE-1402 (100M, Follower) <-> * USB-to-Ethernet adapter <-> Laptop DELL, Windows 11
查看全文
FRDM-A-S32K358 LwIP enablement with RTD 6.0.0.
查看全文
This example project will show user how to use and configure the basic functionalities of WKPU + SIUL2 (GPIO) for wake-up from Standby mode on the S32K358 MCU, with RTC time preservation across Standby and functional reset clock sourced through SIRC. Test HW: FRDM-A-S32K358 / S32K3X8EVB-Q289 MCU: S32K358 IDE: S32DS v3.5 & S32DS v3.6.x SDK release: RTD 6.0.0 Debugger: PE Micro Target: internal_FLASH This example routine configures the WKPU unit for GPIO interrupt wake-up using pins PTH1 (WKPU0) and PTH3 (WKPU15). RTC time is preserved across Standby via the VDDBY supply domain. After wake-up, the functional reset clock is sourced from SIRC before transitioning to the main PLL. No fast wake-up path is used. The routine waits for SW5 to be pressed, then turns off the green LED, and enters Wkpu_EnterStandby() function which: Switches core clock to FIRC. Initializes the WKPU instance. Configures WKPU0 (PTH1) and WKPU15 (PTH3) as wake-up sources. Enters Standby mode (normal wake-up). After pressing USER0/SW4(PTH1), MCU wakes up, resets and polls for USER1/SW5 (PTH3)  or USER0/SW4(PTH1) to be pressed again. Terminal output Settings: 115200 baud — 8 data bits — No parity — 1 stop bit — No flow control (LPUART6) The terminal interaction follows three distinct phases each cycle: boot/wake-up banner → SW6 to read RTC time → SW5 to enter Standby. A representative session is shown below. 1 — Initial power-on (cold start) RTC Standby example, press SW5 to enter standby......... Press SW6 to print RTC date & time......... Reset reason: 15 Current RTC date & time: year 1970 month 1 day 1 hour 0 minutes 0 seconds 0 Current RTC date & time: year 1970 month 1 day 1 hour 0 minutes 0 seconds 2 2 — Enter Standby → Wake-up → RTC time preserved MCU will enter standby........ RTC Standby example, press SW5 to enter standby......... Press SW6 to print RTC date & time......... Reset reason: 28 Current RTC date & time: year 1970 month 1 day 1 hour 0 minutes 0 seconds 13 Current RTC date & time: year 1970 month 1 day 1 hour 0 minutes 0 seconds 14 Current RTC date & time: year 1970 month 1 day 1 hour 0 minutes 0 seconds 14 3 — Multiple Standby cycles (RTC keeps incrementing) MCU will enter standby........ RTC Standby example, press SW5 to enter standby......... Press SW6 to print RTC date & time......... Reset reason: 28 Current RTC date & time: year 1970 month 1 day 1 hour 0 minutes 0 seconds 59 Current RTC date & time: year 1970 month 1 day 1 hour 0 minutes 1 seconds 0 MCU will enter standby........ RTC Standby example, press SW5 to enter standby......... Press SW6 to print RTC date & time......... Reset reason: 28 Current RTC date & time: year 1970 month 1 day 1 hour 0 minutes 1 seconds 4 Current RTC date & time: year 1970 month 1 day 1 hour 0 minutes 1 seconds 6 Disclaimer — PTH3 pin on S32K3X8EVB-Q289: The EVB button mapped to PTH3 may fail to trigger a wake-up event. This is caused by the button connected to the VDD_HV_B (3.3 V) rail, while PTH3 belongs to the VDD_HV_A domain, which defaults to 5 V. The signal level mismatch prevents correct wake-up detection. Workaround: switch Jumper J23 from position 1-2 (default, 5 V) to position 2-3 (3.3 V) to align VDD_HV_A with the button voltage level before testing wake-up via PTH3. This example is provided as is with no guarantees and no support.
查看全文
Application note AN5258 for the S32K1 describes how to implement external pulse counting using DMA and PORT modules. Referring to that application note, we will implement a similar function using SIUL2 and DMA on the S32K3.   1. Introduction This article describes how to perform pulse counting using Enhanced Direct Memory Access (eDMA) and the SIUL2 module on a 32-bit automotive MCU in the S32K3 series. Typically, signal pulses can be counted using the eMios module; however, eMios can also be used for PWM output, ICU, OCU, and GPT. If resources available for eMios are insufficient, consider using the SIUL2 and DMA modules to implement external pulse counting. In this note, the SIUL2 module will be used to capture multiple pulse inputs, and the current major loop iteration count(CITER) register of the eDMA channel will be used as a pulse counter.   2. SIUL2 supports DMA triggering. SIUL2, or System Integration Unit Lite2, is primarily responsible for controlling the electrical attributes, multiplexing functions, GPIO, EIRQ, etc., of external pins. For the S32K3, SIUL2 functions can be categorized as follows: Pin mux/pad control: Configures MSCR, IMCR, etc. GPIO input/output: Typically used via Siul2_Dio/Siul2_Port drivers. External interrupt EIRQ: Only pins with the EIRQn option support SIUL2 external interrupts. DMA is triggered by external edge events. When using SIUL2 pins to trigger DMA, note that: SIUL2 EIRQ[0-15] can be used for interrupt requests or DMA requests, while EIRQ[16-31] can only be used for interrupt requests. In other words, the SIU2L module can support up to 16 external edge events triggering DMA. The file "S32K3xx_IOMUX.xlsx" can be found in the datasheet appendix.   3. Basic Event Chain for SIUL2 Triggered DMA SIUL2 external events still rely on the EIRQ path: a pad needs to be connected to the corresponding EIRQ input via IMCR, input buffering needs to be enabled, rising/falling edge detection needs to be configured, and the relevant request needs to be enabled. In this example, PTB26 is configured as SIUL2 EIRQ13, and external interrupt configuration is completed through registers such as IREER/IFEER and DIRSR. IP_SIUL2->IREER0 |= (1 << 13); // IREER0[EIRE13] = 1 (Enable Rising Edge) IP_SIUL2->IFEER0 &= ~(1 << 13); // IFEER0[EIRE13] = 1 (Enable Falling Edge) IP_SIUL2->DIRSR0 |= (1 << 13); // Select DMA Request for PTB26 The above bare-metal code clearly shows how to configure the Siul2 module to trigger DMA. However, if using RTD, note that: the current "Siul2_Icu" driver does not support configuring the DMA option. Therefore, when using the "Siul2_Icu" component, you also need to manually add and modify the "DIRSRx" bit to 1, i.e., select to enable "DMA request". SIUL2->DIRSR0 |= (1<<13);/* Select DMA Request for PTB26 */   4. DMAMUX / RM Configuration After a DMA request is generated on the SIUL2 side, the request source needs to be connected to a DMA channel via DMAMUX. This path is described in “S32K3xx_DMAMUX_map.xlsx”: 1.EIRQ[0 ~ 7] corresponds to 1 to 7 of DMAMUX0 Source, and EIRQ[8 ~ 15] corresponds to 1 to 7 of DMAMUX1 Source. 2.TCD 0 ~ 15 can be configured with any channel corresponding to EIRQ[0 ~ 7], and TCD 15 ~ 31 can be configured with any channel corresponding to EIRQ[8 ~ 15].  eDMA is mainly used for data transfer between main memory and other peripheral register spaces without CPU intervention. Upon receiving a peripheral request, the eDMA module's second loop begins basic data transfer. We set an empty transfer; each time SIUL2 triggers DMA, an empty transfer is performed, and the CITER bit is decremented accordingly. At this time, the value of the CITER register reflects the actual pulse count. Based on the above principle, we can calculate the pulse count or pulse frequency by periodically reading the CITER register. Note:       The CITER register can only hold a maximum of 15 bits of data. Check the CITER register each time you read it to ensure its value is not zero. When the CITER register is zero, CITER will reload its value from the BITER register and continue decrementing.   5. Example Project Demonstration This example program is based on the S32K344, using RTD version 7.0.1. It implements the function of acquiring the pulse frequency input from PTB26, PTA18, and PTA19 pins. 1.The timer is set to 1 second; the count value read in 1 second can be directly used as the measured frequency. 2. The maximum value of the CITER register is 0x7FFF, or 32767. When the count value exceeds 0x7FFF, the register will be reloaded with an initial value of 0x7FFF.. 3. CITER triggers a DMA interrupt during reload. "g_DmaChx_CallbackCounter" can be used to record the number of overflow reloads. 4. Based on CITER and "g_DmaCh16_CallbackCounter", high-frequency pulse input counting can be achieved. 5. To measure an input frequency of 40kHz, connect the signal generator's output signal to PTB26, PTA18, and PTA19. Senlent_0-1787211805542.png 6. Test result in S32 DS. Senlent_1-1787211927621.png          Using the Siul2 module to trigger DMA for counting is a very efficient method, but it should be noted that if other eDMA transfers are enabled in your application, more testing is required to ensure stable execution of all eDMA channels.  
查看全文
* Detailed Description: * Updated the example lwip_FreeRTOS_s32K358 to enable pinging the lwIP stack from the command window * on the board RD-BESSK358BMU * *ping 192.168.0.209 * *Pinging 192.168.0.209 with 32 bytes of data: *Reply from 192.168.0.209: bytes=32 time=2ms TTL=255 *Reply from 192.168.0.209: bytes=32 time=1ms TTL=255 *Reply from 192.168.0.209: bytes=32 time=1ms TTL=255 *Reply from 192.168.0.209: bytes=32 time=1ms TTL=255 * *Ping statistics for 192.168.0.209: * Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), *Approximate round trip times in milli-seconds: * Minimum = 1ms, Maximum = 2ms, Average = 1ms * * * RD-BESSK358BMU: * - All jumpers in default positions * - SW2 needs to be ON * * Configuration: * - Updated pin configuration * - Updated GMAC clocks * - IP address set to 192.168.0.209 and enabled UDP_ECHO, etc. * - Eth_43_GMAC: configured for RGMII 1G * - Added DIO * * main.c * - Updated only the header * * device.c * - Added RTD workaround for DCMRWF* registers * * test.c * - Commented out the code that shuts down the TCP/IP stack after its predefined timeout * - Added LED task * * ------------------------------------------------------------------------------------------------ * Test HW: RD-BESSK358BMU SCH-91654 REV B1 * MCU: S32K358 * Debugger: Lauterbach Trace32 * Target: internal_FLASH * EVB connection: RJ45 <-> USB-to-Ethernet adapter <-> Laptop DELL, Windows 11
查看全文
Mapping between SPD eMCEM and DCM for S32K311, S32K312, S32K314, S32K322, S32K324, S32K341, S32K342, S32K344.
查看全文