Compile new firmware, UART not available.

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
codyhanks
Posts: 17
Joined: Thu Nov 30, 2017 7:30 pm

Compile new firmware, UART not available.

Post by codyhanks » Wed Jun 16, 2021 7:13 pm

I am attempting to use Firmware updat 1.14, after having been out of Micropython for a while. I am using a board that was previously used on firmware 1.9.3 and worked fine. however after creating a new board folder and using the PYBV11 files, with a few mods it compiles and runs, I am unable to access uart. When using UART(1,9600) "note also 1-4" it responds with


uart = UART('XB',9600)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: UART(1) doesn't exist


same response for
uart = UART(1,9600)
uart =UART(3,9600)
....

They were defined when the firmware was compiled as
// UART config
#define MICROPY_HW_UART1_NAME "XB"
#define MICROPY_HW_UART1_PORT (GPIOB)
#define MICROPY_HW_UART1_PINS (GPIO_PIN_6 | GPIO_PIN_7)
#define MICROPY_HW_UART2_PORT (GPIOD)
#define MICROPY_HW_UART2_PINS (GPIO_PIN_5 | GPIO_PIN_6)
#define MICROPY_HW_UART2_RTS (GPIO_PIN_4)
#define MICROPY_HW_UART2_CTS (GPIO_PIN_3)
#define MICROPY_HW_UART3_NAME "YB"
#define MICROPY_HW_UART3_PORT (GPIOB)
#define MICROPY_HW_UART3_PINS (GPIO_PIN_10 | GPIO_PIN_11)

I am wondering if newer firmware would have an issue with double defining in the
"mpconfigboard.h"
as in 1.9.3 i had them defined for I2c,SPI, and UART with no problem ... is this now an issue?

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Compile new firmware, UART not available.

Post by Roberthh » Thu Jun 17, 2021 8:17 am

UART, SPI and I2C are classes of the machine module. Did you call

from machine import UART

upfront?

Post Reply