lancaster-university / microbit-samples

http://lancaster-university.github.io/microbit-docs
Other
114 stars 72 forks source link

BLE issue with default sample file #31

Open erbabu opened 4 years ago

erbabu commented 4 years ago

Hi I have microbit v1.5 hardware. I have created a sample BLE program using Makecode for UART (keeping only bluetooth UART service block in onstart; do UART read till EOL and display in LED; write accelerometer readings to serial write on button-A click). This hex output from Makecode works fine. No issues. If I add any extra code, the BLE service is not recognizing microbit in smartphone.

So, after going through help doc and internet search, decided to work with mbed IDE assuming that it should allow me to add more services and code. Used the sample program under bluetooth-uart, did the modifications directly in microbitconfig.h as per the config.cpp and the help provided in Martin blog (http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html#mbed_ble). Compiled and flashed the output in microbit. In the pairing mode, microbit is not recognized in smartphone. BLE bitty blue and another BLE UART serial app also didn't recognize microbit.

Read in a post that mbed IDE is having old DAL bits, not the latest 2.1.1, so created a new program and added the microbit:DAL library manually using import from URL method but during compile it threw errors like inside class, we can't assign values to a variable, etc. I am not sure on the error, I assume that mbed IDE compiler may be old.

So, went through microbit github page and installed yotta. I am able to compile and run sample programs like Hello World and accelerometer (which was not working in mbed IDE due to the new accelerometer chip in my hardware version which is supported in makecode and yotta only). In yotta build also, bluetooth-uart is not working and it is not able to recognize microbit hardware in smartphone. If I flash my makecode bluetooth hex file, hardware is recognized and I am able to use UART. For some reason, mbed or yotta version of hex file is not working.

Need help in understanding the issue in this case.

Thanks

erbabu commented 4 years ago

Figured out a way. In config.json, DAL.bluetooth.open=1 worked. It works both in mbed IDE as well as in Yotta build. If this is correct, then please review and update the config files in both bluetooth-uart and bluetooth-services folder.