Copyright © 2016
Texas Instruments Incorporated
F2837xD-FRM-EX-UG-210
USER’S GUIDE
F2837xD Firmware Development Package
Copyright
Copyright © 2016 Texas Instruments Incorporated. All rights reserved. ControlSUITE is a registered trademark of Texas Instruments. Other names and
brands may be claimed as the property of others.
Please be aware that an important notice concerning availability, standard warranty, and use in critical applications of Texas Instruments semicon-
ductor products and disclaimers thereto appears at the end of this document.
Texas Instruments
13905 University Boulevard
Sugar Land, TX 77479
http://www.ti.com/c2000
Revision Information
This is version 210 of this document, last updated on Tue Nov 1 14:46:47 CDT 2016.
2 Tue Nov 1 14:46:47 CDT 2016
Table of Contents
Table of Contents
Copyright . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Revision Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.1 Detailed Revision History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2 Getting Started and Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.2 Project Creation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.3 Debugging Dual Core Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.4 Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
3 Interrupt Service Routine Priorities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
3.1 Interrupt Hardware Priority Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
3.2 PIE Interrupt Priorities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
3.3 Software Prioritization of Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
4 CLA C Compiler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
4.2 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
4.3 Framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
4.4 Getting Started with the CLA Compiler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
4.5 Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
4.6 Known Debugging Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
4.7 Tips and Tricks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
5 CPU 1 Example Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
5.1 ADC PPB Delay Capture (adc_ppb_delay) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
5.2 ADC PPB Limits (adc_ppb_limits) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
5.3 ADC PPB Offset (adc_ppb_offset) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
5.4 ADC Continuous Triggering (adc_soc_continuous) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
5.5 ADC ePWM Triggering (adc_soc_epwm) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
5.6 ADC temperature sensor conversion (adc_soc_epwm_tempsensor) . . . . . . . . . . . . . . . . . . 62
5.7 ADC SOC Software Force (adc_soc_software) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
5.8 ADC Synchronous SOC Software Force (adc_soc_software_sync) . . . . . . . . . . . . . . . . . . . 63
5.9 Blinky . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
5.10 Blinky with DCSM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
5.11 Buffered DAC Enable (buffdac_enable) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
5.12 Buffered DAC Ramp (buffdac_ramp) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
5.13 Buffered DAC Random (buffdac_random) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
5.14 Buffered DAC Sine (buffdac_sine) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
5.15 Buffered DAC Square (buffdac_square) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
5.16 CAN-A to CAN-B External Transmit (can_external_transmit) . . . . . . . . . . . . . . . . . . . . . . 67
5.17 CAN External Loopback Using Driverlib (can_loopback) . . . . . . . . . . . . . . . . . . . . . . . . . 68
5.18 CAN External Loopback Using Bitfields (can_loopback_bitfields) . . . . . . . . . . . . . . . . . . . . 68
5.19 CAN External Loopback with Interrupts (can_loopback_interrupts) . . . . . . . . . . . . . . . . . . . 68
5.20 CLA 5 Tap Finite Impulse Response Filter (cla_adc_fir32_cpu01) . . . . . . . . . . . . . . . . . . . . 69
5.21 CLA arcsine(x) using a lookup table (cla_asin_cpu01) . . . . . . . . . . . . . . . . . . . . . . . . . . 69
5.22 CLA arctangent(x) using a lookup table (cla_atan_cpu01) . . . . . . . . . . . . . . . . . . . . . . . 70
5.23 CLA CRC8 Table-Lookup Algorithm (cla_crc8_cpu01) . . . . . . . . . . . . . . . . . . . . . . . . . . 70
5.24 CLA CRC8 Table-generation Algorithm (cla_crc8table1_cpu01) . . . . . . . . . . . . . . . . . . . . . 71
5.25 CLA Determinant of 3X3 Matrix (cla_det_3by3_cpu01) . . . . . . . . . . . . . . . . . . . . . . . . . 71
Tue Nov 1 14:46:47 CDT 2016 3
Table of Contents
5.26 CLA Division: Newton Raphson Approximation (cla_divide_cpu01) . . . . . . . . . . . . . . . . . . . 71
5.27 CLA 10
X
using a lookup table (cla_exp2_cpu01) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
5.28 CLA e
A
B
using a lookup table (cla_exp2_cpu01) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
5.29 CLA 5 Tap Finite Impulse Response Filter (cla_fir32_cpu01) . . . . . . . . . . . . . . . . . . . . . . 73
5.30 CLA 2 Pole 2 Zero Infinite Impulse Response Filter (cla_iir2p2z_cpu01) . . . . . . . . . . . . . . . . 73
5.31 CLA Logic Test (cla_logic_cpu01) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
5.32 CLA Matrix Multiplication (cla_matrix_mpy_cpu01) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
5.33 CLA Matrix Transpose (cla_matrix_transpose_cpu01) . . . . . . . . . . . . . . . . . . . . . . . . . . 74
5.34 CLA Mixed C and Assembly Code (cla_mixed_c_asm_cpu01) . . . . . . . . . . . . . . . . . . . . . 75
5.35 CLA Primes (cla_prime_cpu01) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
5.36 CLA Shell Sort (cla_shellsort_cpu01) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
5.37 CLA Square Root (cla_sqrt_cpu01) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
5.38 CLA Vector Inverse (cla_inverse_cpu01) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
5.39 CLA Vector Maximum (cla_vmaxfloat_cpu01) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
5.40 CLA Vector Minimum (cla_vminfloat_cpu01) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
5.41 CMPSS Asynchronous Trip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
5.42 CMPSS Digital Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
5.43 CPU Timers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
5.44 SafeCopyCode Reset (dcsm_scc_reset_cpu01) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
5.45 DMA GSRAM Transfer (dma_gsram_transfer) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
5.46 ECAP APWM Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
5.47 ECAP Capture PWM Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
5.48 EMIF ASYNC module (emif1_16bit_asram) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
5.49 EMIF1 SDRAM Module (emif1_16bit_sdram_dma) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
5.50 EMIF1 SDRAM Module (emif1_16bit_sdram_far) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
5.51 EMIF1 SDRAM Module (emif1_32bit_sdram) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
5.52 EPWM dead band control (epwm_deadband) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
5.53 EPWM Trip Zone Module (epwm_trip_zone) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
5.54 EPWM Action Qualifier (epwm_up_aq) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
5.55 EPWM Action Qualifier (epwm_updown_aq) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
5.56 Frequency measurement using EQEP peripheral (Eqep_freqcal) . . . . . . . . . . . . . . . . . . . . 83
5.57 EQEP Speed and Position Measurement (Eqep_pos_speed) . . . . . . . . . . . . . . . . . . . . . . 84
5.58 External Interrupts (ExternalInterrupt) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
5.59 External Interrupts Latency (ExternalInterruptLatency) . . . . . . . . . . . . . . . . . . . . . . . . . . 86
5.60 Device GPIO Setup (GpioSetup) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
5.61 GPIO toggle test program (GpioToggle) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
5.62 HRPWM SFO Test (hrpwm_duty_sfo_v8) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
5.63 HRPWM SFO Test (hrpwm_prdupdown_sfo_v8) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
5.64 HRPWM Slider Test (hrpwm_slider) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
5.65 I2C EEPROM Example (i2c_eeprom) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
5.66 Low Power Modes: Halt Mode and Wakeup (lpm_haltwake) . . . . . . . . . . . . . . . . . . . . . . . 89
5.67 Low Power Modes: HIB Mode and Wakeup (lpm_hibwake) . . . . . . . . . . . . . . . . . . . . . . . 90
5.68 Low Power Modes: Device Idle Mode and Wakeup(lpm_idlewake) . . . . . . . . . . . . . . . . . . . 90
5.69 Low Power Modes: Device Standby Mode and Wakeup(lpm_standbywake) . . . . . . . . . . . . . . 91
5.70 McBSP Loopback (mcbsp_loopback) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
5.71 McBSP Loopback with DMA (mcbsp_loopback_dma) . . . . . . . . . . . . . . . . . . . . . . . . . . 92
5.72 McBSP Loopback with Interrupts (mcbsp_loopback_interrupts) . . . . . . . . . . . . . . . . . . . . . 92
5.73 McBSP Loopback using SPI mode (mcbsp_spi_loopback) . . . . . . . . . . . . . . . . . . . . . . . 93
5.74 SCI Echoback (sci_echoback) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
5.75 SCI FIFO Digital Loop Back Test (sci_looback) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
5.76 SCI Digital Loop Back with Interrupts (sci_loopback_interrupts) . . . . . . . . . . . . . . . . . . . . . 95
5.77 SD card using FAT file system (sd_card) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
4 Tue Nov 1 14:46:47 CDT 2016
Table of Contents
5.78 SDFM Filter Sync CLA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
5.79 SDFM Filter Sync CPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
5.80 SDFM Filter Sync DMA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
5.81 SDFM PWM Sync . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
5.82 Setup CPU01 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
5.83 SPI Digital Loop Back (spi_loopback) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
5.84 SPI Digital Loop Back with DMA (spi_loopback_dma) . . . . . . . . . . . . . . . . . . . . . . . . . . 99
5.85 SPI Digital Loop Back with Interrupts (spi_loopback_interrupts) . . . . . . . . . . . . . . . . . . . . . 99
5.86 Software Prioritized Interrupts(sw_prioritized_interrupts) . . . . . . . . . . . . . . . . . . . . . . . . . 100
5.87 LED Blink Getting Started Program (timed_led_blink) . . . . . . . . . . . . . . . . . . . . . . . . . . 100
5.88 Profiling sine(x) using the TMU (tmu_sinegen) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
5.89 UPP Single Data Rate Receive (upp_sdr_rx) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
5.90 UPP Single Data Rate Transmit (upp_sdr_tx) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
5.91 USB Generic Bulk Device (usb_dev_bulk) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
5.92 USB HID Keyboard Device (usb_dev_keyboard) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
5.93 USB HID Mouse Device (usb_dev_mouse) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
5.94 USB Serial Device (usb_dev_serial) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
5.95 USB Dual Detect (usb_dual_detect) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
5.96 USB HID Keyboard Host (usb_host_keyboard) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
5.97 USB HID Mouse Host (usb_host_mouse) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
5.98 USB Mass Storage Class Host (usb_host_msc) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
5.99 Watchdog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
6 Dual Core Example Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
6.1 ADC & EPWM on CPU2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
6.2 Blinky . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
6.3 CLA arcsine(x) using a lookup table (cla_asin_cpu01) . . . . . . . . . . . . . . . . . . . . . . . . . . 105
6.4 CLA 2 Pole 2 Zero Infinite Impulse Response Filter (cla_iir2p2z_cpu01) . . . . . . . . . . . . . . . . 106
6.5 CPU01 to CPU02 IPC Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
6.6 CPU01 to CPU02 IPC Lite Drivers (cpu01_to_cpu2_ipcdrivers_lite) . . . . . . . . . . . . . . . . . . 107
6.7 CPU01 to CPU02 IPC Write Protect Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
6.8 CPU02 to CPU01 IPC Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
6.9 CPU02 to CPU01 IPC Lite Drivers (cpu02_to_cpu1_ipcdrivers_lite) . . . . . . . . . . . . . . . . . . 108
6.10 CPU02 to CPU01 IPC Write Protect Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
6.11 DMA Transfer Shared Peripheral . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
6.12 Flash Programming Solution SCI for Single or Dual Core . . . . . . . . . . . . . . . . . . . . . . . . 110
6.13 Firmware Upgrade Kernels using USB for Single or Dual Upgrade . . . . . . . . . . . . . . . . . . . 110
6.14 Flash Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
6.15 IPC GPIO toggle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
6.16 Shared RAM management (RAM_management) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
6.17 SDFM Filter Sync CLA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
IMPORTANT NOTICE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Tue Nov 1 14:46:47 CDT 2016 5