Other Parts Discussed in Thread: CC2642R, , CC2650, UNIFLASH, SYSCONFIG, LAUNCHXL-CC2640R2
HI:
I have a custom hardware,Use CC2640R2FRHBR control a device.
I want to use modify "ble5_simple_peripheral" to run on my custom hardware。I have made the following attempts:
1.I modified the code according to this post,Got a simplified version of "ble5_simple_peripheral",and I set the correct RF front-end mode,"ble5_simple_peripheral" can run on my custom hardware,It can be connected to a smartphone。
2.I tried to add the GPIO and SPI drivers to "ble5_simple_peripheral", I read "Running the SDK on Custom Hardware", but it was too brief a description to help me.
Creating a Custom Board File TI-RTOS drivers rely on “board files” for their board-specific configuration parameters. The convention is to name these files based on the development kits provided by TI in addition to a generic Board.h with Board_* definitions to map the proper pins defined by ioc.h. For example, for the simple_peripheral project, the following comprise the set of board files used by the CC2640R2 LaunchPad development kit: Board.h CC2640R2_LAUNCHXL.h CC2640R2_LAUNCHXL.c Note simple_peripheral board files are located in <SDK_INSTALL_DIR>\source\ti\boards\CC2640R2_LAUNCHXL TI recommends to start with the existing set of board files when porting a BLE application to custom development boards. When modifying or porting these board files, the user should consult with TI Drivers API Reference. Tip Board files provided by TI include TI-RTOS driver configuration data structures for various drivers. If the application does not use the associated TI-RTOS drivers, the linker will simply omit them from the application image. The following steps provide guidance on customizing board files for a BLE-Stack 3.03.08.00 project. Duplicate existing board files from existing CC2640R2_LAUNCHXL board files. These files can be found at: <SDK_INSTALL_DIR>\source\ti\boards\CC2640R2_LAUNCHXL Create a copy of the CC2640R2_LAUNCHXL directory and give it a unique meaningful name for your development platform. In this example, we call it MYBOARD. Caution The SimpleLink CC2640R2 SDK also contains board files for TI-RTOS kernel and driver examples. These are not compatible with the BLE-Stack 3.03.08.00 because of differences in RF driver SWI priorities and custom drivers (e.g. TRNG) required by BLE-Stack 3.03.08.00. For BLE-Stack projects, use the files specified above for reference from simple_peripheral. In the MYBOARD directory, rename CC2640R2_LAUNCHXL.c and CC2640R2_LAUNCHXL.h to their MYBOARD.c and MYBOARD.h respectively. Search and replace all references of CC2640R2_LAUNCHXL with MYBOARD in Board.h, MYBOARD.c and MYBOARD.h. Add a new preprocessor define in your project’s board.c and board.h files. Continuing with the MYBOARD example, modify board.c and board.h in <SDK_INSTALL_DIR>\source\ti\blestack\target Replace CC2640R2_LAUNCHXL by MYBOARD in your project’s application predefined symbols (See Accessing Preprocessor Symbols or Accessing Preprocessor Symbols) In board.h, add a link to your Board.h file. #elif defined(CC2640R2_LAUNCHXL) #include "./cc2640r2lp/cc2640r2lp_board.h" #elif defined(MYBOARD) #include "../../boards/MYBOARD/Board.h" In board.c, add the highlighted lines shown below: #elif defined(CC2640R2_LAUNCHXL) #include "./cc2640r2lp/cc2640r2lp_board.c" #elif defined(MYBOARD) #include "../../boards/MYBOARD/Board.h" #include "../../boards/MYBOARD/MYBOARD.c" Explicit references to CC2640R2_LAUNCHXL.h need to be replaced by MYBOARD.h Modify board files to match application requirements PIN structure to match the layout of the board. Add peripheral driver initialization objects according to the board design. For RF driver configuration, see Configuring the RF Front-End for Custom HardwareI'm a first-time user of TI's development tools, and this question has been bothering me for days,Can you provide an example based on CC2640R2FRHBR with GPIO and SPI drivers included in "ble5_simple_peripheral"?Or provide a more detailed step by step like the previous link.
Thank you!