You are here

Cannot use BLE in combination with Custom App anymore after upgrading

2 posts / 0 new
Last post
Gatze
Offline
Last seen: 2 months 2 weeks ago
Joined: 2018-02-03 18:06
Posts: 55
Cannot use BLE in combination with Custom App anymore after upgrading

Hello everybody,

I'm trying to update the FW of my VESC Hardware Version 4.12 from 3.63 to 5.02. Normally this isn't a big deal but the thing is, I have a custom app which integrates a cruise control in my speed knob.

So I followed this explanation again:

http://vedder.se/2015/08/vesc-writing-custom-applications/

But after this, my VESC was bricked and I had to use my ST-link to get it back. After that I tried with the prebuild bin and everything worked. Then I copy and pasted my custom application to the app_custom_template.c and in conf_general.h I uncommented the line (207):

#define APP_CUSTOM_TO_USE            "app_custom_template.c"

After that I uploaded again and my custom application did work ;)

But I could not connect with my Phone to the VESC, this is logical because for example when you choose ADC and UART as app then in app.c you can see at line 96:

    case APP_ADC_UART:
        hw_stop_i2c();
        app_adc_start(false);
        app_uartcomm_start();
        break;

You can see that the uart is started with app_uartcomm_start();

I also did it last time to put where my app_custom is started, so I thought easy fix at line 130

    case APP_CUSTOM:
#ifdef APP_CUSTOM_TO_USE
        hw_stop_i2c();
        app_custom_start();
            
       added -> app_uartcomm_start(); //Keeping wireless going
#endif
        break;

But grrrr, it's still not working. in the app_custom_template, there is also a callback to communicate with the VESC terminal, so I thought maybe that is messing things up, I commented these parts, but still with no luck.

Wireless is only working where the UART is started. Also I saw a new configuration in app general 'Enable Permanent UART'. If I put this on and put my app on ADC, no wirelles, if I put my app back again on 'ADC and UART' wireless is working again. Despite the fact I start my custom application just like 'ADC and Uart' by putting app_uartcomm_start() just as I did with the firmware 3.63 no wireless.

Somebody an idea what the problem is ? and how to solve it ?

Are there any code tags possible on this forum, I could not find them, would make my post more readable. I don't know if this is the right section of the forum, otherwise it can be moved.

Gatze
Offline
Last seen: 2 months 2 weeks ago
Joined: 2018-02-03 18:06
Posts: 55

I already solved it, but I don't know what was wrong.

Anyways, I made a video about it to remember for later and as a reference who wants to use it...

https://youtu.be/lclRbZko9Us