Conversation
|
Hello @burgrp thank you for working on this. Have you seen this page? I think you will find it helpful. 😸 |
|
@burgrp I have switched the branch for this PR to Can you please rebase it against the latest Planning on ordering a few of these myself, thanks for working on it! |
|
@burgrp You are updating |
|
You are right... I will fix it and hopefully it will be possible to merge the PR. |
|
@b0ch3nski , the sub-module issue is fixed, all checks are passing |
|
Thanks! I think now there is some unrelated change also in |
|
@b0ch3nski looks that way to me as well: https://github.com/tinygo-org/tinygo/pull/5106/changes#diff-d7ea94295bc068e99e5edeacb50734849fb40d5aa39cbc68be5e55c0d90bd60a @burgrp one other thing that is needed is to add something to the smoketests to show that at least everything can build. Someplace appropriate in here, please: https://github.com/tinygo-org/tinygo/blob/dev/GNUmakefile#L567-L989 |
Update submodule to fix duplicate SetIDCODE/GetIDCODE method declarations in the generated py32f002bxx.go device file. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@b0ch3nski , @deadprogram smoketests added, net module update reverted |
| return uint8(p) & 0x0F | ||
| } | ||
|
|
||
| func (p Pin) getPort() (*py32.GPIO_Type, uint8) { |
There was a problem hiding this comment.
Better to use unsafe.Add() if you must. Probably even better to use a switch to avoid possible errors.
| switch config.Mode { | ||
|
|
||
| case PinInputFloating: | ||
| port.MODER.ReplaceBits(gpioModeInput, gpioModeMask, pos) |
There was a problem hiding this comment.
I have not installed/run the gen-device-py32 yet, but I assume there are probably some functions like SetMODERInput() that are being generated. Using these are usually preferable, to avoid possible bugs from setting unexpected bits.
| const PinInput PinMode = PinInputFloating | ||
|
|
||
| const ( | ||
| gpioModeInput = 0 |
There was a problem hiding this comment.
Are any of these being generated from the SVD file already? See comment below.
| // peripheral clock frequency. | ||
| func InitSerialWithClock(clockHz uint32) { | ||
| py32UARTClockHz = clockHz | ||
| //Serial.ConfigureWithClock(UARTConfig{}, clockHz) |
| py32.RCC.SetICSCR_HSI_FS(py32.RCC_ICSCR_HSI_FS_Freq24MHz) | ||
|
|
||
| ConfigureSystemTimer(24_000_000) | ||
| machine.InitSerial() |
There was a problem hiding this comment.
This perhaps needs to be moved into an init() function?
See #5200 (comment)
| ], | ||
| "build-tags": [ | ||
| "embedfire_py32f002b", | ||
| "default_uart_pins" |
|
I've taken a look and have some reservations on exported API chosen. I'd like to better understand how we define APIs in machine package to understand if the exported functions implemented here match with what the rest of TinyGo does. Basically working on getting something like |
|
I vibe coded a tool to help us understand the tinygo APIs better. I'll invite you all to check it out to understand what our APIs look like in TinyGo #5224 |
Hi, this is a port of of Puya PY32F super-cheap micro-controllers.
There are two new boards and supported (available on Aliexpress) for PY32F030 and PY32002b.
PY32F030 and PY32002b are supported, PY32F002a and PY32F071 will follow.
It follows the STM32 SVD pattern - there's a small TinyGo SVD repository dependent on Rust py32-rs repo. The repository is here: https://github.com/burgrp/py32-svd . I think it would be worth to move it to tinygo-org.