This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/CC2640R2F: PTM mode problem in CC2640R2

Part Number: CC2640R2F
Other Parts Discussed in Thread: CC2640, LAUNCHXL-CC2640R2

Tool/software: Code Composer Studio

Hello,

I have problem to turn on the PTM mode in CC2640 microcontroller. I follow with instruction which is placed in simpleLink location:

simpleLink location on the disc -> /ti/simplelink_cc2640r2_sdk_3_20_00_21/docs/blestack/ble_user_guide/html/ble-stack-3.x/creating-a-custom-bluetooth-low-energy-application.html#using-production-test-mode-ptm

To the test I use LAUNCHXL-CC2640R2 Rev:1.0 and HCItester(version 3.0.0.37). When I send some HCI command I don't receive answer and in the HCITester console I have timeout error. UART have same setup like in HCItester.

  • Hi Mateusz,

    Have you looked at the HCITester app note and wiki?

    Thanks, 
    Elin

  • Yes, I have seen this documentation

  • Hello,

    I have still problem. Do you have more advices for me?

    Best regards Mateusz

  • Hi Mateusz,

    Do you have this issue on your custom HW only? Or on the LaunchPad as well? Can you show how you have connected UART?

    -Simon

  • Hello Mr. Simon,

    I have this issue on the LaunchPad. Here you have my setup in the LaunchPad:

     

    Here you have my setup in HCITester:

    Here you have my defect in the HCItester console:

    Till I started working with tests, the UART working fine.

  • Hi Mateusz, 

    The code from the CCS screenshot, is that the code for NPI? Because the NPI code should handle UART for you, so you shouldn't have to initialize it yourself.

    The section you refer to in your original post also presents all the changes you have to make in both the stack and app projects to make it work. Here are the changes for the stack project, and here are the changes for the app project. 

    Mateusz B said:
    Till I started working with tests, the UART working fine.

    Can you provide more details about this? What did you test with UART that worked? The screenshot you attached only shows one test, did you try other tests too?

    You should consider starting each test with a reset. This will ensure that the device doesn't start in a bad state. 

    Thanks, 
    Elin

  • Hello,
    first screan came from my UART code- I use this to see that UART worked. I made this without NPI.Document which you added in links, I have in SimpleLink location on the disc, and I follow with that. Anyway NPI interface not worked(this is my main problem). Yes, I try another tests, and also run the test after reset. Result is the same.

    Best regards Mateusz

  • Hi Mateusz,

    It doesn't matter if you follow the file you have locally in your installation directory or the files on Resource Explorer. Provided you are looking at the same version of the SDK; they are identical.

    How did you implement NPI, and what kind of issues did you experience? Were you able to build the project after adding NPI? Did you remove your UART code when adding the NPI code?

    Thanks, 
    Elin

  • Hello,

    when I implemented NPI. I have some problem with compilation. To modiffy project settings I modiffy app file: .projectspec:  I add :

            <!-- NPI Folder -->
            <file path="SRC_BLE_DIR/npi/src/npi_tl_uart.c" openOnCreation="" excludeFromBuild="false" action="link" targetDirectory="NPI" createVirtualFolders="true" applicableConfigurations="FlashROM, FlashROM_StackLibrary"/>
            <file path="SRC_BLE_DIR/npi/src/npi_tl.c" openOnCreation="" excludeFromBuild="false" action="link" targetDirectory="NPI" createVirtualFolders="true" applicableConfigurations="FlashROM, FlashROM_StackLibrary"/>
            <file path="SRC_BLE_DIR/npi/src/npi_frame_hci.c" openOnCreation="" excludeFromBuild="false" action="link" targetDirectory="NPI" createVirtualFolders="true" applicableConfigurations="FlashROM, FlashROM_StackLibrary"/>
            <file path="SRC_BLE_DIR/npi/src/npi_rxbuf.c" openOnCreation="" excludeFromBuild="false" action="link" targetDirectory="NPI" createVirtualFolders="true" applicableConfigurations="FlashROM, FlashROM_StackLibrary"/>
            <file path="SRC_BLE_DIR/npi/src/npi_task.c" openOnCreation="" excludeFromBuild="false" action="link" targetDirectory="NPI" createVirtualFolders="true" applicableConfigurations="FlashROM, FlashROM_StackLibrary"/>
            <file path="SRC_BLE_DIR/npi/src/inc/npi_task.h" openOnCreation="" excludeFromBuild="false" action="link" targetDirectory="NPI" createVirtualFolders="true" applicableConfigurations="FlashROM, FlashROM_StackLibrary"/>
            <file path="SRC_BLE_DIR/npi/src/inc/npi_rxbuf.h" openOnCreation="" excludeFromBuild="false" action="link" targetDirectory="NPI" createVirtualFolders="true" applicableConfigurations="FlashROM, FlashROM_StackLibrary"/>
            <file path="SRC_BLE_DIR/npi/src/inc/npi_tl.h" openOnCreation="" excludeFromBuild="false" action="link" targetDirectory="NPI" createVirtualFolders="true" applicableConfigurations="FlashROM, FlashROM_StackLibrary"/>
            <file path="SRC_BLE_DIR/npi/src/inc/npi_config.h" openOnCreation="" excludeFromBuild="false" action="link" targetDirectory="NPI" createVirtualFolders="true" applicableConfigurations="FlashROM, FlashROM_StackLibrary"/>
            <file path="SRC_BLE_DIR/npi/src/inc/npi_tl_uart.h" openOnCreation="" excludeFromBuild="false" action="link" targetDirectory="NPI" createVirtualFolders="true" applicableConfigurations="FlashROM, FlashROM_StackLibrary"/>
            <file path="SRC_BLE_DIR/npi/src/inc/npi_frame.h" openOnCreation="" excludeFromBuild="false" action="link" targetDirectory="NPI" createVirtualFolders="true" applicableConfigurations="FlashROM, FlashROM_StackLibrary"/>
            <file path="SRC_BLE_DIR/npi/src/inc/npi_data.h" openOnCreation="" excludeFromBuild="false" action="link" targetDirectory="NPI" createVirtualFolders="true" applicableConfigurations="FlashROM, FlashROM_StackLibrary"/>
            <file path="SRC_BLE_DIR/npi/src/inc/npi_ble.h" openOnCreation="" excludeFromBuild="false" action="link" targetDirectory="NPI" createVirtualFolders="true" applicableConfigurations="FlashROM, FlashROM_StackLibrary"/>

    I also add 3 files to the ICall folder:

            <file path="SRC_BLE_DIR/icall/app/icall_hci_tl.c" openOnCreation="" excludeFromBuild="false" action="link" targetDirectory="ICall" createVirtualFolders="true" applicableConfigurations="FlashROM, FlashROM_StackLibrary, FlashROM_StackLibrary_RCOSC"/>
            <file path="SRC_BLE_DIR/icall/inc/icall_hci_tl.h" openOnCreation="" excludeFromBuild="false" action="link" targetDirectory="ICall" createVirtualFolders="true" applicableConfigurations="FlashROM, FlashROM_StackLibrary, FlashROM_StackLibrary_RCOSC"/>
            <file path="SRC_BLE_DIR/icall/inc/icall_ble_api.h" openOnCreation="" excludeFromBuild="false" action="link" targetDirectory="ICall" createVirtualFolders="true" applicableConfigurations="FlashROM, FlashROM_StackLibrary, FlashROM_StackLibrary_RCOSC"/>
           

    After that I also have problems in compilation. To solve this problem I changed "_npimsg_t" on the "_npi2msg_t",  because compiler give me error "multipy definition":

    Before I start work with NPI I turned off task which is responsible on UART. Before I program the Flash I build  stack library and app project.

    Best regards Mateusz

  • Hi Mateusz, 

    Did you also make the code changes in both the stack and the app projects mentioned in the links I sent in the previous post?

    Can you provide a screenshot of your source tree with all your files?

    Have you tried removing your own NPI code before following the checklist you mentioned in your original post?

    Thanks, 
    Elin