Open tcpipchip opened 3 years ago
the HEX created is a hello world, right ? How can i compile the other examples ?
Oh, that's cool. Perhaps you could share the process so that other can more easily do the same? We have a docs site coming soon, and I'd welcome a PR to the README?
You'll find quite a few examples in the "samples" folder of this repo. I'm afraid I haven't had chance to organize the samples here as well as I did for micro:bit v1 (Universities have been really busy due to all the covid mitigation work we've had to do this last 12 months... so there hasn't been much time for voluntary projects!). please consider these a work-in-progress. Most samples are fine, but I expect a few may be a little out of date. Please raise an issue here if you have problems.
The process to run a samples is simple though. They are all compiled by default, you just have to call the relevant function from main.cpp (in the source folder):
I hope this helps
If got error, in CmakeCache.txt, then
replace
CMAKE_EXE_LINKER_FLAGS:STRING=-Wl,--enable-auto-import
by
CMAKE_EXE_LINKER_FLAGS:STRING=-W
Dont forget nano ~/.bashrc export PATH=$PATH:$HOME/gcc-arm/bin
Success!
Enjoy Miguel Wisintainer
when you are back, let me know i have questions!
Thanks very much for this @tcpipchip!
It will be very useful to be able to point others at your resource here, so that they can benefit from what you've learned.
If you have questions, feel free to raise them in an issue. We'll try to answer them as soon as we can. :)
Thanks @finneyj
Here some one of questions that i remember now :)
About the .HEX/BIN created by the MicroBit V2 compiler, does it includes de BOOTLOADER of NORDIC NRF52833 ?
For example, if the user not use the MASS STORAGE DEVICE (DAP-LINK) to transfer, but just a SWD (SEGGER, ST-LINKV V2) to transfer, will work ?
I'm following in tcpipchip's footsteps running on MSys. I can compile and build files in microbit-v2-samples, but when I copy the resulting .hex file to MAINTENANCE it shows a FAIL text document
error: The starting address for the interface update is wrong. type: user
This is with the default hello world example -- Any clues?
Has anyone a known good .hex file for a microbit v2
PS I also have it running on a Debian Linux PC, same issue.
You should not be copying the resulting hex file to maintenance. Copy the file to the standard MICROBIT mass storage device.
@tcpipchip The MICROBIT.HEX file produced is a full image for the NRF52833 MCU.
Using the DAPLink interface is the simplest way to get that image onto the NRF52833, but if you prefer to use a different SWD programmer that should work fine too.
@basicchip Does your micro:bit always boot into MAINTENANCE mode? It really shouldn't...
If it does, this implies that the KL27 interface MCU has somehow lost its DAPLINK firmware. You can recover by reflashing the DAPLINK firmware by drag/drop of the latest DAPLInk firmware in whilst the device is in MAINTENENCE mode. it should then reboot into normal MICROBIT mode after that.
You can get the DAPLink firmware from the micro:bit foundation website. Make sure you use the V2 version :)
Thank you finneyj and james, sorry I misread the download procedure. Hello World now comes up on my microbit V2
Can you use the DAPLINK to do any GDB debugging, with pyocd for instance?
@basicchip Yes absolutely.
Here is the pyocd command I use:
pyocd-gdbserver --persist -t nrf52840 -bh -r
You must use the nrf52840 target for pyocd to get a functional memory map (nrf52833 is not yet added).
In the micro:bit samples v2 directory:
arm-none-eabi-gdb --eval "target remote :3333" build/MICROBIT
Looking for a UART example (there is one in the codal v2 samples), not sure I can mix and match. I have not got docker running on Msys, but I believe I got it running on debian, but need to switch PCs
@jamesadevine @finneyj I have stock some NRF52833 mcu Is there some bootloader that allows to transter the hex created by microcode (Microsoft) and execute on it ?
@tcpipchip this bootloader exists from adafruit: https://github.com/adafruit/Adafruit_nRF52_Bootloader I believe I added support for the 833 some time ago.
Ah -- misremembered, I added a driver for AP102s -- the 833 support was already there and worked great.
hi @jamesadevine
Can you test this attached MAKECODE to see if run on NRF52833 using your bootloader ?
The makecode example writes 1 and 0 in many GPIOS :)
I'm afraid not -- I no longer have a board with the bootloader installed. You'll have to try it yourself!
Ok, i will test soon! Bootloader ok! Mass storage device showing on pc
Wow, the python converter fail to convert the hex (makecode) to dfu, to me transfer to the nrf52833 :(
Success! Running Microbit no U-BLOX NINA B4 :) I had to edit the HEX, because is to in one!
I finally compiled using Msys32![image](https://user-images.githubusercontent.com/11488460/111054369-ef2bbf00-844a-11eb-932c-0691a318f005.png)