Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NRF52833 #29

Open
tcpipchip opened this issue Mar 14, 2021 · 22 comments
Open

NRF52833 #29

tcpipchip opened this issue Mar 14, 2021 · 22 comments

Comments

@tcpipchip
Copy link

I finally compiled using Msys32
image

@tcpipchip
Copy link
Author

the HEX created is a hello world, right ?
How can i compile the other examples ?

@finneyj
Copy link
Contributor

finneyj commented Mar 14, 2021

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):

  • #include "tests.h"
  • delete the hello world code
  • call the relevant samples function from the samples folder instead.
  • run "python build.py" to generate the new HEX file

I hope this helps

@tcpipchip
Copy link
Author

tcpipchip commented Mar 15, 2021

image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
If got error, in CmakeCache.txt, then
replace
CMAKE_EXE_LINKER_FLAGS:STRING=-Wl,--enable-auto-import
by
CMAKE_EXE_LINKER_FLAGS:STRING=-W
image
image

Dont forget
nano ~/.bashrc
export PATH=$PATH:$HOME/gcc-arm/bin

Success!

Enjoy
Miguel Wisintainer

@tcpipchip
Copy link
Author

when you are back, let me know
i have questions!

@finneyj
Copy link
Contributor

finneyj commented Mar 15, 2021

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. :)

@tcpipchip
Copy link
Author

tcpipchip commented Mar 16, 2021

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 ?

@basicchip
Copy link

basicchip commented Mar 16, 2021

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.

@jamesadevine
Copy link
Contributor

You should not be copying the resulting hex file to maintenance. Copy the file to the standard MICROBIT mass storage device.

@finneyj
Copy link
Contributor

finneyj commented Mar 16, 2021

@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.

@finneyj
Copy link
Contributor

finneyj commented Mar 16, 2021

@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 :)

https://tech.microbit.org/software/daplink-interface/

@basicchip
Copy link

basicchip commented Mar 16, 2021

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?

@jamesadevine
Copy link
Contributor

@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 

@basicchip
Copy link

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

@tcpipchip
Copy link
Author

tcpipchip commented Jul 12, 2022

@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 ?

@jamesadevine
Copy link
Contributor

@tcpipchip this bootloader exists from adafruit: https://github.com/adafruit/Adafruit_nRF52_Bootloader I believe I added support for the 833 some time ago.

@jamesadevine
Copy link
Contributor

Ah -- misremembered, I added a driver for AP102s -- the 833 support was already there and worked great.

@tcpipchip
Copy link
Author

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 :)

microbit-ublox-b4.zip

@jamesadevine
Copy link
Contributor

I'm afraid not -- I no longer have a board with the bootloader installed. You'll have to try it yourself!

@tcpipchip
Copy link
Author

tcpipchip commented Jul 12, 2022

Ok, i will test soon! Bootloader ok! Mass storage device showing on pc

@tcpipchip
Copy link
Author

tcpipchip commented Jul 12, 2022

Wow, the python converter fail to convert the hex (makecode) to dfu, to me transfer to the nrf52833 :(
image

@tcpipchip
Copy link
Author

Success! Running Microbit no U-BLOX NINA B4 :)
I had to edit the HEX, because is to in one!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants