Page 1 of 1

[Nucleo-F411RE] Assign REPL on UART6

Posted: Sun Mar 22, 2020 6:32 pm
by LuSP
Hello. Is it possible to assign REPL on UART6 interface?

I tried to use pyb.repl_uart command, but got the following in the terminal:

Code: Select all

Connecting to COM6 (buffer-size 512)...
Trying to connect to REPL  connected
Testing if sys.stdin.buffer exists
The terminal was hanging on this.

The method with os.dupterm() command also did not help.

If I tried to initialize UART2 interface, the REPL said the following:

Code: Select all

ValueError: UART is static and can't be init'd
Is there a way to assign the REPL to UART6, and use UART2 as a regular interface through USB?

Re: [Nucleo-F411RE] Assign REPL on UART6

Posted: Mon Mar 23, 2020 12:24 am
by jimmo
Yes this is possible, but you'll have to build your own firmware.

See the last paragraph of this reply: viewtopic.php?f=2&t=7844&#p44737 The built-in "default REPL uart" is separate to the dupterm mechanism.

So if you change the REPL UART in mpconfigboard.h to UART6, you'll be free to use UART2 for whatever you like.

Re: [Nucleo-F411RE] Assign REPL on UART6

Posted: Tue Mar 24, 2020 7:02 pm
by LuSP
It seems that it's easier to learn C and write firmware from scratch in C than trying to compile micropython in Ubuntu. No arm-none-eabi-gcc package in repos, no way to add PPA repository (Says there are no files dedicated for my release). Crap!

Re: [Nucleo-F411RE] Assign REPL on UART6

Posted: Tue Mar 24, 2020 11:09 pm
by dhylands
You can get the toolchain from ARM. The link is in the micropython readme: https://github.com/micropython/micropyt ... 32-version

In particular, the end of the first paragraph has: https://launchpad.net/gcc-arm-embedded which then points to the ARM site:
https://developer.arm.com/tools-and-sof ... ain/gnu-rm

ARM provides this particular toolchain and updates it quarterly. They have toolchains for Windows, Mac, and Linux.

Re: [Nucleo-F411RE] Assign REPL on UART6

Posted: Wed Mar 25, 2020 1:43 am
by jimmo
Have you tried gcc-arm-none-eabi rather than arm-none-eabi-gcc

I'm not an Ubuntu user so I have no idea and this may be completely unhelpful but this seems almost unbelievable that Ubuntu wouldn't have this?

I looked at packages.ubuntu.com and they have it for xenial, bionic, disco, eoan, focal -- what are you running?

Re: [Nucleo-F411RE] Assign REPL on UART6

Posted: Wed Mar 25, 2020 4:49 pm
by dhylands
I know that from time to time I have tried and used the Ubuntu version of arm-none-eabi-gcc provided with Ubuntu, but I've also had it not work. It also seems to lag behind the ARM version by quite a bit IIRC.