[PCA10028/NRF51] - Building for the nRF51822 - PCA10028 board - some advice?

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
Post Reply
bgolab
Posts: 12
Joined: Sat Nov 30, 2019 10:36 pm

[PCA10028/NRF51] - Building for the nRF51822 - PCA10028 board - some advice?

Post by bgolab » Sat Nov 30, 2019 10:46 pm

Hi,

I tried to follow the build instructions posted here:
https://github.com/micropython/micropyt ... /ports/nrf

both for non BLE:
make BOARD=pca10028

and BLE setup:
make BOARD=pca10028 SD=s110

I managed to build hex file withou any problems.
-----------------------
Let's focus on the first non BLE build.

I took the hex file and flashed the board (I am C developer so the flashing the boards is an easy task for me).
Unfortunately after flashing the board the board is silent (I see no uart output).

I tried a few uart speeds (115200, 9600, 38400).

If someone could share his/her experience in building for nrf51822 board (aka PCA10028).

Thanks you,
bogdan
Last edited by bgolab on Sun Dec 08, 2019 8:32 am, edited 1 time in total.

c45713
Posts: 44
Joined: Fri Dec 09, 2016 7:09 pm

Re: Building for the nRF51822 - PCA10028 board - some advice?

Post by c45713 » Sun Dec 01, 2019 1:03 pm

Hi bogdan,

I did play with the pca10028 as recent as this week. For me it did work.

Could you try hit the reset button on the board a few times to see if it eventually comes up?

There has also been a recurring issue with Segger and RTS/CTS. You might want to try disable Flow Control in the boards/mpconfigboard.h to see if you can get REPL up without RTS/CTS. If this works, you can re-enable it, and pull the RTS pin to Ground with a wire.

For reference, i've been using the Jlink version 6.42d.

bgolab
Posts: 12
Joined: Sat Nov 30, 2019 10:36 pm

Re: Building for the nRF51822 - PCA10028 board - some advice?

Post by bgolab » Sun Dec 01, 2019 5:29 pm

Thank you for your comments.

1. First, I use BLE400 board for this purpose. I use this board as a substitute for PCA10028 without any issue when developing programs in C.

2. Yes, my board needs to be reset manually after flashing. Actually I turn off/on the board. And it looks like I do not get anything through the UART (Pin 9, Pin 11). The UART was tested several times - either through C compiled programs or espruino (javascript interpreter).
So the UART hardware is working - just uploaded espruino on the board to verify it.
I looked int the Micropython repository and I believe that the Pin9/11 are used for the uart.

3. I use ST-LINK to flash it (hex file is uploaded to the board using Keil IDE). I did it many times for C compiled programs and also for javascript interpreter (espruino). This worked always reliably - I mean the flashing process out of the hex file.

4. My build environment looks like this:
- fresh Ubuntu 18.04.3 LTS installed on the VMWare player
- all required packages installed
- git micropython cloned
- then make called using the cli command: 'make BOARD=pca10028' to produce the hex file
- the hex file is used to flash the board

If you could share some details regarding the building process/environment you use I'd be grateful.

5. If you could share the hex file I would test it on my board - this way I could verify if the building process is right.

Thank you!

bgolab
Posts: 12
Joined: Sat Nov 30, 2019 10:36 pm

Re: Building for the nRF51822 - PCA10028 board - some advice?

Post by bgolab » Sun Dec 01, 2019 7:01 pm

6. I tried to remove the RTS/CTS lines from the mpconfigboard.h but the build fails in this case due to lack of the RTS/CTS pins defined.
7. It looks like the RTS/CTS lines are in LOW state ( I believe LOW means accept new data).

c45713
Posts: 44
Joined: Fri Dec 09, 2016 7:09 pm

Re: Building for the nRF51822 - PCA10028 board - some advice?

Post by c45713 » Sun Dec 01, 2019 7:49 pm

I found the schematic for the BLE400 board: https://www.waveshare.com/w/upload/1/1b ... ematic.pdf
I have not studied in detail yet, but i suggest that we also try to swap the RX and TX. As this is not really clear to me in the schematic.

Attaching the 3 hex files i have generated from today's master.
Attachments
firmware_pca10028_nofc_rx_tx_swap.zip
(137.43 KiB) Downloaded 7 times
firmware_pca10028_nofc.zip
(137.38 KiB) Downloaded 8 times
firmware_pca10028_fc.zip
(137.29 KiB) Downloaded 7 times

bgolab
Posts: 12
Joined: Sat Nov 30, 2019 10:36 pm

Re: Building for the nRF51822 - PCA10028 board - some advice?

Post by bgolab » Sun Dec 01, 2019 8:17 pm

I studied the schematic: CP2102 pin 26 (=TXD) is connected to the pin P11 of the nrf51822.
The pins.csv defines the P11 as RX:
UART_TX,P9
UART_RX,P11

It looks fine for me.

Please clarify what the 'fc' means in your file name scheme.

Thanks

bgolab
Posts: 12
Joined: Sat Nov 30, 2019 10:36 pm

Re: Building for the nRF51822 - PCA10028 board - some advice?

Post by bgolab » Sun Dec 01, 2019 8:18 pm

ok, it's flow control. thanks

bgolab
Posts: 12
Joined: Sat Nov 30, 2019 10:36 pm

Re: Building for the nRF51822 - PCA10028 board - some advice?

Post by bgolab » Sun Dec 01, 2019 8:32 pm

Problem solved!

I tried your firmware_pca10028_fc.hex (btw. it's different from my non-ble image).
And it did not work.

And here is the sad part: I had the st-link programmer connected to the board. After disconnecting it all works fine. It also works fine when the usb side of the st-link is connected to the PC.

Shame!.

Thank you very much for your support. The firmware_pca10028_fc.hex was really useful to be sure that the build is OK. You also made me look into the schematic.

Of course it is interesting why my build is different from yours!.

c45713
Posts: 44
Joined: Fri Dec 09, 2016 7:09 pm

Re: Building for the nRF51822 - PCA10028 board - some advice?

Post by c45713 » Sun Dec 01, 2019 8:44 pm

Yeay! :D I'm glad to hear that it worked out!

I can only speculate on why our builds are different. Maybe the compiler might have an impact. I built these with arm-none-eabi 8-2018-q4-major (aka 8.2.1).

bgolab
Posts: 12
Joined: Sat Nov 30, 2019 10:36 pm

Re: Building for the nRF51822 - PCA10028 board - some advice?

Post by bgolab » Sun Dec 01, 2019 8:57 pm

Right. Mine is little bit older - it's 6.3.1.

I'll enjoy the current build today. Then I'll try BLE. Actually the NUS.

Thanks again!

Post Reply