Back to Blog

OMAPL138 + SPARTAN6 DSP+ARM+FPGA Development Examples

#C6748#DSP#开发例程#tcp#OMAPL138

Table of Contents

This example is developed based on the Xinmai OMAPL138+SPARTAN6 evaluation board.

  1.   Development Board Preparation 16
    1. Check Emulator Driver Installation 17
  2. Program Loading and Flashing 19
    1. Program Loading and Flashing via Emulator 19
      1. Configure Project Profile Information 19
      2. Test Emulator Connection 20
      3. Load GEL File 21
      4. CCS Connects to Development Board CPU 22
      5. Check CPU Version Number 23
      6. Load File Flashing Program 24
      7. Flash Program to NAND FLASH via Emulator 24
      8. NAND FLASH Flashing Image Conversion Method 29
    2. Program Loading and Flashing via Serial Port 31
      1. Serial Port Loading and Flashing Image Conversion Method 31
      2. Program Loading and Execution 33
      3. Flash Program to NAND FLASH via Serial Port 39
      4. Flash Program to SPI FLASH via Serial Port 42
    3. Run Program from SD Card 44
      1. SD Boot Image Conversion Method 44
      2. Flash Program to SD Card 46
      3. Boot Development Board in SD Card Mode 49
    4. Flash Program to NAND FLASH via SD Card 49
      1. Format SD Card 49
      2. Prepare Flashing Image 53
  3. CCS Project Creation, Compilation, and Import 55
    1. Bare-metal Project Creation 57
      1. Create New Project 57
      2. Write Program 60
      3. Compile and Run Program 60
    2. SYS/BIOS Project Creation 62
      1. Create SYS/BIOS Platform Configuration File 64
      2. Create New SYS/BIOS Project 70
      3. Compile and Run Program 75
    3. CCS Project Import and Compilation Steps 75
    4. Enable Multi-threaded Compilation 82
    5. Add Automatic Generation of NAND FLASH Flashing .ais File 84
  4. StarterWare Demo Examples 88
    1. DEMO - Comprehensive Example 89
    2. GPIO_LED - GPIO Output (LED) 93
    3. GPIO_KEY - GPIO Input (Key Interrupt) 93
    4. GPIO_KEY_EDMA - Key Triggered EDMA Event 94
    5. GPIO_KEY_TIMER_EventCombine - Key and Timer Interrupt 96
    6. TIMER - Timer 96
    7. TIMER_Dual_32-bit_Chained - Chained 32-bit Mode Timer/Counter 97
    8. TIMER_Dual_32-bit_UnChained - Independent 32-bit Mode Timer/Counter 99
    9. TIMER_Dual_32-bit_UnChained_4-bit_Prescaler - Independent 32-bit Mode / Additional 4-bit

Prescaler Timer/Counter 101

    1. UART0_INT - UART0 Serial Interrupt Transmit/Receive 103
    2. UART1_POLL - UART1 Serial Polling Transmit/Receive 104
    3. UART2_INT - UART2 Serial Interrupt Transmit/Receive 105
    4. UART2_EDMA - EDMA Serial Transmit/Receive 106

4.14 RS485 - RS485 Serial Polling Transmit/Receive 107

    1. TL_MULTUART_INT - Multi-UART Module (Polling Mode) 109
    2. TL_MULTUART_POLL - Multi-UART Module (Interrupt Mode) 110
    3. IIC_EEPROM - IIC EEPROM Read/Write 112
    4. SPI_FLASH - SPI FLASH Read/Write 113
    5. SPI_EDMA_FLASH - SPI FLASH Read/Write Test 114
    6. SPI_DAC_AD5724 - 4-Channel DAC Module (Analog SPI Bus) 115
    7. SPI_DAC_AD5724v2 - 4-Channel DAC Module (SPI Bus) 117
    8. WatchDog - Watchdog 118
    9. NMI - Non-Maskable Interrupt 119
    10. PWM - High-Precision Pulse Width Modulator PWM Output 119
    11. ECAP_APWM - Enhanced Capture Module ECAP Auxiliary Output 121
    12. PWM_ECAP - Enhanced Capture Module ECAP Capture 124
    13. RTC - RTC Clock 126
    14. LCD - LCD Display 127
    15. VGA - VGA Display 129
    16. LCD_TOUCH_4INCH3 - 4.3-inch Touchscreen 130
    17. LCD_TOUCH - 7-inch Touchscreen 131
    18. LCD_TOUCH_5INCH6/10INCH4/12INCH/15INCH - Various Sizes of Touchscreens 132
    19. GRLIB_DEMO - StarterWare Graphics Library Controls 133
    20. MMCSD - SD Card Read/Write 134
    21. SATA - SATA Enumeration Test 134
    22. USB_DEV_BULK - USB OTG Slave Mode (USB BULK Pipe Communication) 135
    23. USB_DEV_MSC - USB OTG Slave Mode (Virtual Storage Device) 144
    24. USB_DEV_SERIAL - USB OTG Slave Mode (USB Virtual Serial Port) 154
    25. USB_HOST_KEYBOARD - USB OTG Host Mode (USB Keyboard) 157
    26. USB_HOST_MOUSE - USB OTG Host Mode (USB Mouse) 157
    27. USB_HOST_MSC - USB OTG Host Mode (U Disk Content View) 158
    28. ENET_HTTPD - Network Web Server 160
    29. ENET_HTTPD_RMII - Network Web Server (using RMII Interface) 162
    30. ENET_ECHO - Network Socket Communication 165
    31. AUDIO_LINE_OUT - Line Out Audio Output (EMDA Mode) 171
    32. AUDIO_LINE_OUT_INTR - Line Out Audio Output (Interrupt Mode) 175
    33. AUDIO_LINE_OUT_POLL - Line Out Audio Output (Polling Mode) 176
    34. AUDIO_LINE_OUT_WAV - Line Out Audio Output (File Import Mode) 177
    35. AUDIO_MIC_IN - Mic In Audio Input (EMDA Mode) 180
    36. AUDIO_MIC_IN_INTR - Mic In Audio Input (Interrupt Mode) 181
    37. AUDIO_MIC_IN_POLL - Mic In Audio Input (Polling Mode) 182
    38. AUDIO_MIC_IN_SAVEMEM - Mic In Audio Input (Save File Mode) 183
    39. AUDIO_MIC_IN_WAVE - Mic In Audio Input (Waveform Input Mode) 188
    40. AUDIO_LINE_IN - Line In Audio Input (EMDA Mode) 191
    41. AUDIO_LINE_INTR - Line In Audio Input (Interrupt Mode) 192
    42. AUDIO_LINE_POLL - Line In Audio Input (Polling Mode) 193
    43. AUDIO_LINE_IN_SAVEMEM - Line In Audio Input (Save File Mode) 193
    44. AUDIO_LINE_IN_WAVE - Line In Audio Input (Waveform Input Mode) 199
    45. McBSP - McBSP Bus Data Transmit/Receive 202
    46. VPIF_OV2640 - VPIF Bus CMOS Camera Data Acquisition 204
    47. Memory_Benchmark - Memory Read/Write Speed Test 206
    48. NandFlash - NAND FLASH Read/Write Test 206
    49. EMIF_AD7606 - EMIFA Bus 8-Channel Parallel AD Data Acquisition 208
    50. EMIF_AD7606v2 - EMIFA Bus 8-Channel Parallel AD Data Acquisition 212
    51. EMIF_AD7606_10K - CPU Acquisition at 10k Sampling Rate 215
    52. EMIF_AD7606_200K_EDMA - EDMA Acquisition at 200k Sampling Rate 216
    53. EMIF_AD7656 - EMIFA Bus 6-Channel Parallel AD Data Acquisition 217
    54. EMIF_AD7656v2 - EMIFA Bus 6-Channel Parallel AD Data Acquisition 220
    55. EMIF_AD8568 - EMIFA Bus 8-Channel Parallel AD Data Acquisition 222
    56. EMIF_AD8568v2 - EMIFA Bus 8-Channel Parallel AD Data Acquisition 224

4.71 EMIF_AD8568_100K - 100 KHz Sampling of AD8568 8-Channel AD Data 227

    1. EMIF_FPGA - EMIFA Bus FPGA Read/Write Test 230
    2. EMIF_FPGA_DMA - EMIFA Bus FPGA Read/Write Test (EDMA Optimized) 232
    3. EDMA3 - EDMA3 One-Dimensional Data Transfer 234
    4. EDMA3_TRANSPOSE - EDMA3 Two-Dimensional Data Transfer 235
    5. uPP_B_TO_A - uPP Bus FPGA Read/Write Test 236
    6. uPP_2CH - uPP Inter-board Dual Communication Test 240
    7. TL2515_CAN - Dual CAN Communication Test 242
    8. TL5147_VGA - Composite Video Input VGA Display Test 244
    9. TL5147_LCD - Composite Video Input LCD Display Test 246
    10. TL5147_LCD_2CH - Composite Video Dual Channel Input LCD Display Test 248
    11. H264Encoder - Encoding Example Test 249

4.83 NRF24L01 - 2.4G Wireless Module Test 253

    1. HC-SR04 - Ultrasonic Ranging Test 256
    2. DHT11 - Temperature and Humidity Sensor Test 258
    3. WIFI_UART - Serial WIFI Module Test 260
    4. RFID - RFID Radio Frequency Identification Test 264
    5. ECAP_REMOTE - Infrared Remote Control Test 266
    6. BTUART - Serial Bluetooth Module Test 268
    7. MPU6050 - 3-Axis Accelerometer Gyroscope Test 270
    8. ZIGBEE - Serial to Zigbee Wireless Test 272
    9. ClockOut - Clock Frequency Test 274
    10. DSPClockSpeed - CPU Clock Test 277
    11. Fsfat - SD Card Read/Write Test 278
    12. SPI0 - SPI0 Test Example 279
    13. UART2_INT_FIFO - UART2 FIFO Interrupt Mode 281
    14. TL5147_LCD_3CH_Multi - TL5147 Camera 3-Channel Image Acquisition 282
    15. TL5147_LCD_2CH_SYNC - Dual 5147 Camera Simultaneous Acquisition and Display 285
    16. EDMA3_LINK - EDMA Linked Operation Mode 286
    17. EDMA3_LED - EDMA Mode LED Blinking 287
    18. EMIF_AD7606_PinBoard - EMIF Expansion Board Test 287
  1.   SYS/BIOS Demo Examples 289
    1. Board - Comprehensive Example 289
    2. GPIO_LED - Task 295
    3. GPIO_LED_MUTEX - Preemptive Multitasking 295
    4. GPIO_LED_STATIC - Static Task Creation 296
    5. Semaphore_Binary - Binary Semaphore 300
    6. Semaphore_Counting - Counting Semaphore 301
    7. Clock - Clock 302
    8. Timestamp - SYS/BIOS Timestamp (Generic) 302
    9. Timestamp_C674x - SYS/BIOS Timestamp (Specific) 303
    10. Timer - Timer (Generic) 303
    11. Timer_C674x - Timer (Specific) 304
    12. Timer_C674x_Runtime - Timer (Dynamic Creation) 304
    13. Timer_C674x_Runtime_Reload - Timer (Dynamic Creation, Change Timing Period) 305
    14. HWI_C674x - Hardware Interrupt (HWI Device Specific Component) 306
    15. HWI_C674x_Hook - Hardware Interrupt (HWI Hook Function) 306
    16. HWI_C674x_Nest - Hardware Interrupt (HWI Interrupt Nesting) 307
    17. HWI_Runtime - Hardware Interrupt (HWI) 307
    18. HWI_Runtime_Post_SWI - Hardware Interrupt (HWI Post Software Interrupt) 308
    19. HWI_Runtime_Post_Task - Hardware Interrupt (HWI Trigger Task) 308
    20. SWI - Software Interrupt (Static Configuration) 309
    21. SWI_Runtime - Software Interrupt (SWI) 309
    22. SWI_Runtime_Post_Conditionally_andn - Software Interrupt (Conditional Trigger ANDN) 310
    23. SWI_Runtime_Post_Conditionally_dec - Software Interrupt (Conditional Trigger DEC) 310
    24. SWI_Runtime_Post_Unconditionally_or - Software Interrupt (Unconditional Trigger OR) 311
    25. MEMORY - Memory Allocation 312
    26. MMCSD - SD Card RAW Mode 313
    27. MMCSD_FatFs - SD Card FAT File System 315
    28. UART1 - UART1 Serial Polling Transmit/Receive 318
    29. UART2 - UART2 Serial Polling Transmit/Receive 319
    30. UART2_INT - UART2 Serial Interrupt Receive 320
    31. AudioLineInSave - Line In Audio Input and Save 321
    32. AudioMicInSave - Mic In Audio Input and Save 321
    33. AudioPlayMP3 - MP3 Audio Playback (SD Card) 322
    34. AudioPlayWAV - WAV Audio Playback (SD Card) 322
    35. LCD_TOUCH - Touchscreen 323
    36. TCP_Client - TCP Client 324
    37. TCP - TCP Server 331
    38. UDP - UDP Communication 335
    39. TCP_Benchmark - TCP Send/Receive Speed Test 338
    40. Telnet - Telnet Protocol 342
    41. Telnet - TFTP Protocol 348
    42. WebServer - Network Web Server 355
    43. NDK_UIA - Network-based System Analysis 363
    44. NDK_Runtime - Network Web Server (Supports Serial Input IP) 371
    45. WebServer_RMII - Network Web Server (using RMII Interface) 374
    46. WebServer_Audio_Video - Web Server Audio and Video Experiment 382
    47. MJPEG_Streamer - IP Camera Network Camera 386
    48. RawSocket - Ethernet Data Link Layer Communication 389
    49. EDMA3 - EDMA3 One-Dimensional Data Transfer 400
    50. McBSP_LoopBack - McBSP Internal Loopback Test 401
    51. McBSP - McBSP External Loopback Test 401
    52. Gate - SYS/BIOS Gate Protection 403
    53. Queue - SYS/BIOS Queue 403
    54. Event - SYS/BIOS Event Module 404
    55. Mailbox - SYS/BIOS Mailbox Communication 404
    56. SLEEP - CPU Low Power Mode 405
    57. VFSCALE - Dynamic Frequency and Voltage Scaling Test 406
    58. uPP_B_TO_A - uPP Loopback Test 407
    59. ADS1278_uPP - AD Module Acquisition Test (using uPP) 410
    60. Servo Motor Test - Control Servo Motor Operation via DSP and FPGA 411
  2. Algorithm Demo Examples 412
    1. FIR - Finite Impulse Response Filter 412
    2. IIR - Infinite Impulse Response Digital Filter 419
    3. Matrix - Matrix Operations 423
    4. FFT - Fast Fourier Transform/Inverse Transform 425
    5. FFT_Benchmark - Fast Fourier Transform/Inverse Transform (Cache On/Off Speed Comparison) 428
    6. FFT_DIT2 - Radix-2 Decimation-in-Time Fast Fourier Transform/Inverse Transform (In-place Computation) 451
    7. DCT - Image Discrete Cosine Transform 454
    8. RGB2Gray - RGB24 Image to Grayscale 457
    9. HIST - Grayscale Image Histogram 461
    10. InteEqualize - Histogram Equalization 470
    11. ImageReverse - Image Inversion 478
    12. Canny - Edge Detection 484
    13. Threshold - Grayscale Image Binarization 490
    14. LinerTrans - Grayscale Image Linear Transformation 497
    15. Zoom - Image Zoom 504
    16. Rotate - Image Rotation 510
    17. MATH - Math Function Library 517
    18. UniversalCopy - Codec Engine Based Data Copy Algorithm 518
    19. MP3Decode - MP3 Decoding 519
    20. MP3Decode_SD - MP3 Decoding (Cache Enabled and SD Access) 520
    21. AACLCDecode - AACLC Decode AAC Decoding 522
    22. AACHEv2Decode - AACHEv2 Decode AAC Decoding 524
    23. AACLCEncode - AACLC Encode AAC Encoding 526
    24. G711ADecode - G711A Rate Speech Encoding 527
    25. G711ADecode - G711A Rate Speech Decoding 528
    26. ImageProcess - Digital Recognition 530
    27. FaceDetect - Face Detection and Tracking 533
    28. ImageProcessQR - QR Code Scanning 534
    29. ImageProcessChar - Character Recognition 538
    30. ImageProcessAlph - Alphabet Recognition 541
    31. Plate Recognition Demo - License Plate Recognition 544
  3. PRU Demo Examples 565
    1. PRU_GPIO_LED - PRU Control GPIO Output 569
    2. PRU_GPIO_KEY - PRU Control GPIO Input 569
    3. PRU_TL5724_DAC - PRU Driven DAC Output Test 569
    4. PRU_TL5724_DACv2 - PRU Control AD5724 Output Continuous Waveform 571
    5. PRU_TL7606_ADC - PRU Triggered ADC Analog Acquisition 574
    6. PRU_TL8568_ADC - PRU Triggered ADC Analog Acquisition 576
    7. PRU_uPP_B_TO_A - PRU Control uPP Data Transfer 577
    8. PRU_AD8568_SAVE - PRU Control AD8568 Data Acquisition and SD Card Storage 581
    9. PRU_TIMER2_POLL - PRU Control Timer 582
    10. PRU to DSP_Interrupt - PRU Sends Interrupt to DSP 582
  4. Other Demo Examples 583
    1. GPIO_LED_Assembly - GPIO Output (Standard Assembly) 583
    2. GPIO_LED_LinearAssembly - GPIO Output (Linear Assembly) 583
    3. GPIO_LED_C++ - GPIO Output (C++) 583
    4. GPIO_KEYv2 - Interrupt Example without StarterWare Function Library 583
    5. GPIO_LED_C_Mix - C Language Calls Linear Assembly, Assembly Statements, and Functions 584
    6. GPIO_LED_C++_Mix - C++ Language Calls C Language, Linear Assembly, Assembly Statements, and Functions 584 More Help 585

Appendix A 586