Texas Instruments | Processor SDK RTOS Customization: Modifying Board library to change UART instanc (Rev. A) | Application notes | Texas Instruments Processor SDK RTOS Customization: Modifying Board library to change UART instanc (Rev. A) Application notes

Texas Instruments Processor SDK RTOS Customization: Modifying Board library to change UART instanc (Rev. A) Application notes
Application Report
SPRAC32A – March 2016 – Revised March 2018
Processor SDK RTOS Customization: Modifying Board
Library to Change UART Instance on AM335x
Lalindra Jayatilleke
ABSTRACT
This document describes the procedure to modify the default UART0 BeagleBone Black example in the
AM335x Processor SDK RTOS package to enable UART1. On the BeagleBone Black (BBB) P9 header,
pins 24(TX) and 26(RX) are connected to UART1. This application note shows how to enable and verify
that UART1 is functioning on the BBB.
Tutorial Environment
• Code Composer Studio™ (CCS) v 7.2.0
• Windows® 7 Host
• Processor SDK RTOS AM335x x.x.x.x install path C:\ti\pdk_am335x_x_x_x\packages. This location is
referenced as ${PDK_INSTALL_DRI} in this document.
• BeagleBone Black Rev C (BBB) with a debugger header soldered to P2
• Blackhawk USB100v2
Prerequisites
1. Download the AM335x Processor SDK RTOS package for Windows.
2. Install the package.
3. Create the MyExampleProjects running the pdkProjectCreate.bat file described in the instructions in
PDK Example and Test Project Creation. Here is a video showing the process:
https://training.ti.com/processor-sdk-device-drivers-setup-test.
NOTE:
Ensure that the new packages installed are registered with CCS prior to running the .bat file.
Future versions of Processor SDK RTOS for AM335x might have variations in code that
could alter the steps outline in this application note.
Code Composer Studio is a trademark of Texas Instruments.
Windows is a registered trademark of Microsoft Inc.
All other trademarks are the property of their respective owners.
SPRAC32A – March 2016 – Revised March 2018
Submit Documentation Feedback
Processor SDK RTOS Customization: Modifying Board Library to Change
UART Instance on AM335x
Copyright © 2016–2018, Texas Instruments Incorporated
1
www.ti.com
1
2
3
Contents
Software Modification ....................................................................................................... 3
Platform Development Kit (PDK) Board Library Modifications ......................................................... 6
Testing the Changes ........................................................................................................ 7
List of Figures
2
1
PinMux Utility ................................................................................................................. 3
2
PinMux Parameters
3
PinMux Configuration Loaded.............................................................................................. 4
4
Add UART 1 .................................................................................................................. 4
5
UART Instance ............................................................................................................... 5
6
Description .................................................................................................................... 5
7
Generated Files .............................................................................................................. 6
8
Unzipped Files ............................................................................................................... 6
9
BBB With FTDI Cable Connected to UART1 Pins on Header P3 ..................................................... 7
10
Test Output ................................................................................................................... 8
.........................................................................................................
Processor SDK RTOS Customization: Modifying Board Library to Change
UART Instance on AM335x
3
SPRAC32A – March 2016 – Revised March 2018
Submit Documentation Feedback
Copyright © 2016–2018, Texas Instruments Incorporated
Software Modification
www.ti.com
1
Software Modification
1.1
Generating a New PinMux Configuration Using the PinMux Utility
This procedure uses the cloud-based pinmux utility (see Figure 1).
Figure 1. PinMux Utility
1. Select the PinMux parameters as in Figure 2.
Figure 2. PinMux Parameters
2. Navigate to ${PDK_INSTALL_DIR}packages\ti\starterware\tools\pinmux_config\am335x.
SPRAC32A – March 2016 – Revised March 2018
Submit Documentation Feedback
Processor SDK RTOS Customization: Modifying Board Library to Change
UART Instance on AM335x
Copyright © 2016–2018, Texas Instruments Incorporated
3
Software Modification
www.ti.com
3. Load beaglebone_black_config (see Figure 3).
Figure 3. PinMux Configuration Loaded
4. Click the + symbol at the UART row to add UART 1 to the configuration. (The default config only has
UART0. See Figure 4.)
Figure 4. Add UART 1
4
Processor SDK RTOS Customization: Modifying Board Library to Change
UART Instance on AM335x
SPRAC32A – March 2016 – Revised March 2018
Submit Documentation Feedback
Copyright © 2016–2018, Texas Instruments Incorporated
Software Modification
www.ti.com
This action creates the new UART instance in the requirements section (see Figure 5).
Figure 5. UART Instance
5. Change the description to match the fields in Figure 6.
Figure 6. Description
Pins D15 (RX) and D16 (TX) are used.
SPRAC32A – March 2016 – Revised March 2018
Submit Documentation Feedback
Processor SDK RTOS Customization: Modifying Board Library to Change
UART Instance on AM335x
Copyright © 2016–2018, Texas Instruments Incorporated
5
Platform Development Kit (PDK) Board Library Modifications
www.ti.com
6. Change the Category filter to starterware (see Figure 7).
7. Download the pinmux files.
Figure 7. Generated Files
8. Unzip the files (see Figure 8).
Figure 8. Unzipped Files
The current cloud-based pinmux utility downloads the AM335x pinmux files with a generic filename,
without any platform affiliation.
9. At the bottom of am335x_pinmux.h, change extern pinmuxBoardCfg_t gAM335xPinmuxData[]; to
extern pinmuxBoardCfg_t gBbbPinmuxData[];.
10. Change am335x_pinmux_data.c to am335x_beagleboneblack_pinmux_data.c.
11. Change gAM335xPinmuxData to gBbbPinmuxData at the end of the file at pinmuxBoardCfg_t
gAM335xPinmuxData[] = of am335x_beagleboneblack_pinmux_data.c.
The previous modifications apply to the pinmux utility version 4.x and might be fixed in a future release.
12. Replace the existing files with the new files in
${PDK_INSTALL_DIR}packages\ti\starterware\board\am335x.
2
Platform Development Kit (PDK) Board Library Modifications
The following areas in the AM335x processor SDK RTOS package must be modified to enable UART1 on
the BBB.
2.1
Power and Clocking
To modify the power and clocking, do as follows:
1. Modify the PRCMModuleEnable() instance from UART0 to UART1 in the file
${PDK_INSTALL_DIR}\packages\ti\board\src\bbbAM335x\bbbAM335x.c.
/* UART */status = PCRMModuleEnable (CHIPDB_MOD_ID_UART, 1U, OU);
2.2
Adding Peripheral Instances
To add peripheral instances, do as follows:
1. Change the UART instance in the file
${PDK_INSTALL_DIR}\packages\ti\board\src\bbbAM335x\include\board_cfg.h from 0 to 1.
#define BOARD_UART_INSTANCE 1
2. Change the UART instance from 0 to 1 inside PINMUXModuleConfig() in file
${PDK_INSTALL_DIR}\packages\ti\board\src\bbbAM335x\bbbAM335x_pinmux.c.
status = PINMUXModuleConfig (CHIPDB_MOD_ID_UART, 1U, NULL) ;
6
Processor SDK RTOS Customization: Modifying Board Library to Change
UART Instance on AM335x
SPRAC32A – March 2016 – Revised March 2018
Submit Documentation Feedback
Copyright © 2016–2018, Texas Instruments Incorporated
Platform Development Kit (PDK) Board Library Modifications
www.ti.com
2.3
Rebuild the Board Library
The board and starterware libraries must be recompiled for the changes to be effective. The Processor
SDK RTOS Customization: Modifying Board library to change UART instance on AM335x wiki page has
instructions on how to set up the pdk environment for rebuilding. The board library can be remade with >
gmake board. Starterware can be remade with> gmake starterware (this can take a while).
3
Testing the Changes
3.1
CCS Project Modifications
To modify the CCS project, do as follows:
1. Import UART_BasicExample_bbbAM335x_armTestProject into the CCS project workspace.
2. Rebuild the UART example in CCS.
3.2
Hardware Setup to Run the Test Code
To set up the hardware to run the test code, do as follows:
1. Connect the device as shown in Figure 9 to pipe the UART1 data to the COM port where the FTDI
cable is connected to test UART1.
Figure 9. BBB With FTDI Cable Connected to UART1 Pins on Header P3
Figure 9 does not show the power and CCS debugger connections. The application note assumes
these are connected.
SPRAC32A – March 2016 – Revised March 2018
Submit Documentation Feedback
Processor SDK RTOS Customization: Modifying Board Library to Change
UART Instance on AM335x
Copyright © 2016–2018, Texas Instruments Incorporated
7
Testing the Changes
2.
3.
4.
5.
www.ti.com
Connect the BBB target configuration.
Load the .out file onto the target.
Open a Teraterm or Putty console with the COM port for the FTDI cable at baud 115200:.
Click Run in CCS to see Figure 10.
Figure 10. Test Output
Figure 10 shows the UART example now working on UART1.
For technical support, post questions at http://e2e.ti.com. Post only comments about Processor SDK
RTOS Customization: Modifying Board Library to Change UART Instance on AM335x (SPRAC32).
8
Processor SDK RTOS Customization: Modifying Board Library to Change
UART Instance on AM335x
SPRAC32A – March 2016 – Revised March 2018
Submit Documentation Feedback
Copyright © 2016–2018, Texas Instruments Incorporated
Revision History
www.ti.com
Revision History
NOTE: Page numbers for previous revisions may differ from page numbers in the current version.
Changes from Original (March 2016) to A Revision ....................................................................................................... Page
•
•
•
•
•
•
•
•
•
•
Changed Code Composer Studio version from 6.1.2 to 7.2.0. ......................................................................
Updated Prerequisites section. ..........................................................................................................
Updated Note. .............................................................................................................................
Updated navigation link. ..................................................................................................................
Updated enerating a New PinMux Configuration Using the PinMux Utility sequence. ...........................................
Updated Power and Clocking sequence. ..............................................................................................
Updated Adding Peripheral Instances sequence. .....................................................................................
Removed Interrupt Configuration section. .............................................................................................
Updated CCS Project Modifications section. ..........................................................................................
Updated Hardware Setup to Run the Test Code sequence. ........................................................................
SPRAC32A – March 2016 – Revised March 2018
Submit Documentation Feedback
Copyright © 2016–2018, Texas Instruments Incorporated
Revision History
1
1
1
3
6
6
6
7
7
8
9
IMPORTANT NOTICE FOR TI DESIGN INFORMATION AND RESOURCES
Texas Instruments Incorporated (‘TI”) technical, application or other design advice, services or information, including, but not limited to,
reference designs and materials relating to evaluation modules, (collectively, “TI Resources”) are intended to assist designers who are
developing applications that incorporate TI products; by downloading, accessing or using any particular TI Resource in any way, you
(individually or, if you are acting on behalf of a company, your company) agree to use it solely for this purpose and subject to the terms of
this Notice.
TI’s provision of TI Resources does not expand or otherwise alter TI’s applicable published warranties or warranty disclaimers for TI
products, and no additional obligations or liabilities arise from TI providing such TI Resources. TI reserves the right to make corrections,
enhancements, improvements and other changes to its TI Resources.
You understand and agree that you remain responsible for using your independent analysis, evaluation and judgment in designing your
applications and that you have full and exclusive responsibility to assure the safety of your applications and compliance of your applications
(and of all TI products used in or for your applications) with all applicable regulations, laws and other applicable requirements. You
represent that, with respect to your applications, you have all the necessary expertise to create and implement safeguards that (1)
anticipate dangerous consequences of failures, (2) monitor failures and their consequences, and (3) lessen the likelihood of failures that
might cause harm and take appropriate actions. You agree that prior to using or distributing any applications that include TI products, you
will thoroughly test such applications and the functionality of such TI products as used in such applications. TI has not conducted any
testing other than that specifically described in the published documentation for a particular TI Resource.
You are authorized to use, copy and modify any individual TI Resource only in connection with the development of applications that include
the TI product(s) identified in such TI Resource. NO OTHER LICENSE, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE TO
ANY OTHER TI INTELLECTUAL PROPERTY RIGHT, AND NO LICENSE TO ANY TECHNOLOGY OR INTELLECTUAL PROPERTY
RIGHT OF TI OR ANY THIRD PARTY IS GRANTED HEREIN, including but not limited to any patent right, copyright, mask work right, or
other intellectual property right relating to any combination, machine, or process in which TI products or services are used. Information
regarding or referencing third-party products or services does not constitute a license to use such products or services, or a warranty or
endorsement thereof. Use of TI Resources may require a license from a third party under the patents or other intellectual property of the
third party, or a license from TI under the patents or other intellectual property of TI.
TI RESOURCES ARE PROVIDED “AS IS” AND WITH ALL FAULTS. TI DISCLAIMS ALL OTHER WARRANTIES OR
REPRESENTATIONS, EXPRESS OR IMPLIED, REGARDING TI RESOURCES OR USE THEREOF, INCLUDING BUT NOT LIMITED TO
ACCURACY OR COMPLETENESS, TITLE, ANY EPIDEMIC FAILURE WARRANTY AND ANY IMPLIED WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL
PROPERTY RIGHTS.
TI SHALL NOT BE LIABLE FOR AND SHALL NOT DEFEND OR INDEMNIFY YOU AGAINST ANY CLAIM, INCLUDING BUT NOT
LIMITED TO ANY INFRINGEMENT CLAIM THAT RELATES TO OR IS BASED ON ANY COMBINATION OF PRODUCTS EVEN IF
DESCRIBED IN TI RESOURCES OR OTHERWISE. IN NO EVENT SHALL TI BE LIABLE FOR ANY ACTUAL, DIRECT, SPECIAL,
COLLATERAL, INDIRECT, PUNITIVE, INCIDENTAL, CONSEQUENTIAL OR EXEMPLARY DAMAGES IN CONNECTION WITH OR
ARISING OUT OF TI RESOURCES OR USE THEREOF, AND REGARDLESS OF WHETHER TI HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
You agree to fully indemnify TI and its representatives against any damages, costs, losses, and/or liabilities arising out of your noncompliance with the terms and provisions of this Notice.
This Notice applies to TI Resources. Additional terms apply to the use and purchase of certain types of materials, TI products and services.
These include; without limitation, TI’s standard terms for semiconductor products http://www.ti.com/sc/docs/stdterms.htm), evaluation
modules, and samples (http://www.ti.com/sc/docs/sampterms.htm).
Mailing Address: Texas Instruments, Post Office Box 655303, Dallas, Texas 75265
Copyright © 2018, Texas Instruments Incorporated
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertising