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.

TMS320F28069: Bluetooth connected to UART not working in Standalone mode

Part Number: TMS320F28069
Other Parts Discussed in Thread: CONTROLSUITE

Hi

  We have built a 28069 prototype taking reference from the 28069 launchpad schematic. We have also developed a code

based on the SCI-echoback example. Apart from UART we are using ADC  as well as EPWM peripherals. We are transmitting 

data via UART and receiving it via bluetooth in a mobile serial terminal.

  The Application works fine in an emulator mode as well as standalone mode, except for the data received in bluetooth serial terminal.

In the standalone mode all other functions works properly, except that data is not received in the bluetooth serial terminal.. Kindly help

resolve this issue..

Thanks

Lenin.

  

  • Lenin,

    Could you please check how the board is powered in standalone mode?

    - Ken
  • HI Ken

      The board is powered from a separate 5 V Power supply followed by an 3.3 V LDO. The same 5 V power supply is used to power the HC-05  

    bluetooth module as well. We are using SCI-A for the bluetooth module..

    Thanks

    Lenin.

  • Hi Lenin,

    So are you using a 5V-3.3V translator? I've tested HC-05 with 3.3V supply too, it works well. How have you connected the module with the controller?

    Regards,
    Gautam
  • Hi Gautam

    Yes for the microcontroller we are using a 5 to 3.3 V translator. For the HC 05, the same 5V power supply used for the MCU , is directly given. Anyway its working fine in the emulator mode... only in the standalone it is not working.. however all the other functions, ADC/PWM works
    fine.....

    Thanks
    Lenin.
  • Lenin Prakash said:
    Anyway its working fine in the emulator mode

    You mean when the debugger is connected, right?

    Lenin Prakash said:
    only in the standalone it is not working

    Transmission doesn't work or both Txn and Rxn don't work? Are these ISR based or polling based?

    Regards,

    Gautam

  • Hi Gautam

    Yes in the Emulator, the debugger is connected. The de-bugger is built using a C2000 launchpad, the Isolators between the USB to J-Tag IC and the MCU is desoldered, In order to access the J-tag Pins ( TRST, TCK, TDI, TDO, TCLK). These pins are connected to the corresponding Pins of our MCU board. It works well. In our board also we have a boot switch to change between emulator mode and standalone mode.

    In the current application, we are doing oneway communication only ( MCU to HC-05). We are not using interrupts.. For every 10 seconds we are writing the data in the UART.

    Thanks
    Lenin.
  • First, did you check whether rest of the code works in standalone mode? Verify GPIO toggling or some other functionality.
  • Gautam

    I have allready mentioned in all my earlier posts, apart from the Bluetooth, all other functions including ADC, PWM and other GPIO's works as intended..

    Thanks
    Lenin.
  • Did you probe the SCIATX pin for periodic 10sec data on DSO? Do you observe the same?
  • Hi Ken

    I tried to run the SCI echoback program in standalone mode in the 28069 Launchpad. I was able to do that
    by changing the 28069_RAM_lnk.CMD to F28069.CMD

    and using the

    memcpy(&RamfuncsRunStart, &RamfuncsLoadStart, (size_t)&RamfuncsLoadSize);

    as mentioned in

    e2e.ti.com/.../2433393

    It worked in both emulator mode as well as standalone mode
    without changing the position of the boot switches given in the launchpad..

    The Application code developed by us is based on the echoback example, by adding the ADC and PWM functions to it..
    However this dosen't works fully...

    In the sense the code is partially executed.. Some of the GPIO initialization done before the for loop works ( LED's in the launch pad works as intended) however the remaining part of the codes are not executed..

    It seems the code is not fully copied into the Flash..

    Kindly help resolve..

    Thanks
    Lenin.
  • It worked in both emulator mode as well as standalone mode
    without changing the position of the boot switches given in the launchpad..

    We followed the same procedure as above to run our application in the standalone mode in the launchpad..

    The Application code developed by us is based on the echoback example, by adding the ADC and PWM functions to it..
    However this dosen't works fully...

    In the sense the code is partially executed.. Some of the GPIO initialization done before the for loop works ( LED's in the launch pad works as intended) however the remaining part of the codes are not executed..

    It seems the code is not fully copied into the Flash..

    Kindly help resolve..

    Thanks
    Lenin.
  • Hi Ken

    I tried to run the SCI echoback program in standalone mode in the 28069 Launchpad. I was able to do that
    by changing the 28069_RAM_lnk.CMD to F28069.CMD

    and using the

    memcpy(&RamfuncsRunStart, &RamfuncsLoadStart, (size_t)&RamfuncsLoadSize);

    as mentioned in

    e2e.ti.com/.../2433393

    It worked in both emulator mode as well as standalone mode
    without changing the position of the boot switches given in the launchpad..

    We tried the same procedure to run our application in the launchpad..

    The Application code developed by us is based on the echoback example, by adding the ADC and PWM functions to it..
    However this dosen't works fully...

    In the sense the code is partially executed.. Some of the GPIO initialization done before the for loop works ( LED's in the launch pad works as intended) however the remaining part of the codes are not executed..

    It seems the code is not fully copied into the Flash..

    Kindly help resolve..

    Thanks
    Lenin.
  • Lenin,

    In main() check the order of the function calls. For example, in the workshop code InitPieCtrl() must happen before InitWatchdog(), and InitFlash() happens after the memcpy:

    //--- CPU Initialization
    InitSysCtrl(); // Initialize the CPU (FILE: SysCtrl.c)
    InitGpio(); // Initialize the shared GPIO pins (FILE: Gpio.c)
    InitPieCtrl(); // Initialize and enable the PIE (FILE: PieCtrl.c)
    InitWatchdog(); // Initialize the Watchdog Timer (FILE: WatchDog.c)

    //--- Copy all Flash sections that need to run from RAM (use memcpy() from RTS library)

    // Section secureRamFuncs contains user defined code that runs from CSM secured RAM
    memcpy(&secureRamFuncs_runstart, &secureRamFuncs_loadstart, (Uint32)&secureRamFuncs_loadsize);

    //--- Initialize the Flash and OTP
    InitFlash(); // Initialize the Flash

    //--- Peripheral Initialization
    InitAdc(); // Initialize the ADC (FILE: Adc.c)
    InitEPwm(); // Initialize the EPwm (FILE: EPwm.c)
    InitECap(); // Initialize the ECap (FILE: ECap.c)
    // InitDma(); // Initialize the DMA (FILE: Dma.c)
    InitCla(); // Initialize the Cla (FILE: Cla.c)

    As a reference, the F28069 workshop can be found at:

    processors.wiki.ti.com/.../C2000_Archived_Workshops

    I hope this helps. If this answers your question, please click the green "Verified Answer" button. Thanks.

    - Ken
  • Hi Ken

    The initialization is done as mentioned by you only. However the issue remains.. The starting few line of the code gets executed both in emulation mode as well
    as standalone mode..

    It seems the full code is not executed... Should I need to make any changes in the F28069.cmd file.. to make use of all the sectors in flash...
    I doubt currently all the flash sector is not utilized...

    Thanks
    Lenin.
  • Hi Ken

    I changed the F28069.cmd to F28069_nonBIOS_flash.cmd (one available in spra9581).. But still the code works only in the emulation mode and not in the standalone mode..

    Thanks
    Lenin.
  • Hi Lenin,

    Here's a quick solution (not sure how comfortable you would be), simply build your application on this example project: "flash_f28069"
    C:\ti\controlSUITE\device_support\f2806x\v151\F2806x_examples_ccsv5\flash_f28069

    Regards,
    Gautam
  • Hi Gautham

    I'm using the same F28069.cmd file in my project ( which is used in the project you have mentioned) It works for the example projects. However in my application
    it seems the code is not executed fully. Though it works both in emulation mode and standalone mode.

    I used an another F28069_nonBIOS_flash.cmd.. however now the application works fine in the emulation mode
    and not in the standalone.

    F28069.cmd seems uses only the sector A of the flash... F28069_nonBIOS_flash.cmd uses all the sectors...

    However issue remains..

    Thanks
    Lenin.
  • Lenin,

    You need to be careful when selecting a linker cmd file. The F28069.cmd is designed to work with all of the projects in controlSUITE. The F28069_nonBIOS_flash.cmd (which is very similar to the linker cmd file in Lab 12) is designed to work with a single project. Notice that in this linker cmd file the all of the flash sectors are grouped together, which might explain why your application works when the emulator is connected. If it is not working when the emulator is not connected you might need to double check where the CodeStartBranch.asm is being linked. Please see the Lab 12 directions in the workshop manual:

    processors.wiki.ti.com/.../C2000_Archived_Workshops

    I hope this helps. If this answers your question, please click the green "Verified Answer" button. Thanks.

    - Ken
  • Hi Ken

       I have followed all the steps as mentioned in the Lab 12 manual and everything works as mentioned in the below step of Lab 12 manual

    "24. Now do Run  Go Main. The code should stop at the beginning of your main()routine. If you got to that point succesfully, it confirms that the flash has been programmed properly, that the bootloader is properly configured for jump to flash mode, and that the codestart section has been linked to the proper address

    However still the code is not fully executed in standalone. In standalone. Only few initialization code alone is being executed. But it works well in emulation mode.

    I'm currently using the F28069_nonBIOS_flash.cmd ..

    In 28069.cmd only partial execution happens in both emulation and standalone mode

    F28069_nonBIOS_flash.cmd  -  In this works fine in emulation mode... but partial execution in standalone mode...

    Can i have a proper linker file that's compatible with control suite projects and that uses all the sectors of the Flash...

    Thanks

    Lenin.

  • Hi Ken

    I'm getting a warning message as below..


    creating output section "ramfuncs" without a SECTIONS specification C/C++ Problem


    Thanks
    Lenin.
  • Lenin,

    In the workshop link that I previously sent you, please see Lab 12. Open the Lab_12.cmd file and in the SECTIONS area please notice how the secureRamFuncs are specified.

    I hope this helps. If this answers your question, please click the green "Verified Answer" button. Thanks.

    - Ken
  • Hi Ken

     Finally  I have built my application based on the SPRA9581 project from the scratch and the project works fine in both emulation mode as well as standalone mode.

       However, how to make this linker file F28069_flash_nonbios.cmd or Lab12.cmd  (that utilizes all the Flash sector) compatible with the control suite projects is yet to be resolved..

    This will help for new development works..

    Thanks

    Lenin.

  • Lenin,

    From my earlier post - the F28069.cmd is designed to work with all of the projects in controlSUITE. The F28069_nonBIOS_flash.cmd (which is very similar to the linker cmd file in Lab 12) is designed to work with a single specific project. That is, the F28069.cmd is common across all of the examples, but it is not necessarily compatible with projects outside of controlSUITE. If you want to use the F28069.cmd file from controlSUITE for your specific project, you would need to modify it accordingly (such as combining the flash blocks for your application). As you pointed out, the application report and workshop lab .cmd file works fine with your project. Likewise, these .cmd file may or may not work with all of the controlSUITE examples. So, I would not recommend using these .cmd files with the controlSUITE examples. You need to develop a linker .cmd file that is specific to your project.

    I hope this helps. If this answers your question, please click the green "Verified Answer" button. Thanks.

    - Ken
  • Lenin,

    It's been a while since we have heard from you last. Therefore, we are assuming you were able to resolve your issue. If this isn’t the case, please reject this resolution or reply to this thread. If this thread locks, please make a new thread describing the current status of your issue. Thank you.

    - Ken