lancaster-university / microbit-samples

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

build related issue #2

Closed shou7783 closed 8 years ago

shou7783 commented 8 years ago

I build and flash the sample code to microbit following the tutorial on webside. http://lancaster-university.github.io/microbit-docs/offline-toolchains/ Just install the yotta tool, clone the sample code,

git clone https://github.com/lancaster-university/microbit-samples
cd microbit-samples

add target

yotta target bbc-microbit-classic-gcc

and then build it,

yotta build

It appears to work fine but when I want to flash code again over the air (DFU), there would be some problems. If I flash code via the micro:bit ios app, it would throw the following error, and the microbit seems not working (cannot do anything, and can't be found via bluetooth). img_0806 img_0808

And If I want to flash code myself, I set the DFU Control characteristic to 0x01 ( rebooting the micro:bit into the Nordic Semiconductor bootloader), the microbit also seems not working at all.

Is there any missing steps or commands during the flash process?

Any help will be appreciated!

jamesadevine commented 8 years ago

Hi @shou7783,

We applied some patches to the timer class in the underlying mbed libraries to resolve a whole host of other issues with regard to timer granularity.

We were recently made aware of this by @martinwork https://github.com/lancaster-university/microbit-dal/issues/140, I will look into this today.

finneyj commented 8 years ago

yes, definitely an issue. I suspect the new timer is not being closed down properly before we try to reboot into DFU mode... and an interrupt fires when there is no real handler present.

jamesadevine commented 8 years ago

Hi @shou7783,

Fixed, and if you are interested, here is the commit: https://github.com/lancaster-university/mbed-classic/commit/1fb8ab4c1942d7eaa265e032e203c01a3bd71019 .

You will have to manually run git pull for microbit-dal to see these changes, as it contains the updated reference to mbed-classic.

P.S. If you've already got a local version of mbed-classic in your yotta_modules folder, remember to delete it before you run yt build or else it won't pull the update.

shou7783 commented 8 years ago

Thanks, @jamesadevine !!