-
Notifications
You must be signed in to change notification settings - Fork 102
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
Gd32v Support #21
Gd32v Support #21
Conversation
regz translation
Is it possible to automate the translation or read the start.S file in zig build or microzig? |
Status
By adding some changes you find errors in the api during the build: Uart error: ./src/core/uart.zig:6:28: error: container '.chip' has no member called 'Uart'
const SystemUart = chip.Uart(index);
^
./src/modules/boards/logan-nano/logan-nano.zig:60:29: note: called from here
const uart0 = micro.Uart(0).getOrInit(.{
^
./src/modules/boards/logan-nano/logan-nano.zig:59:44: note: called from here
pub fn debugWrite(string: []const u8) void { Pin error: ./src/core/pin.zig:22:13: error: container '.chip' has no member called 'parsePin'
chip.parsePin(@field(board.pin_map, spec))
^
./tests/blinky.zig:9:36: note: called from here
.@"Logan Nano" => micro.Pin("PC13"), // error in 'parsePin'
^
./tests/blinky.zig:4:17: note: called from here
const led_pin = if (micro.config.has_board) |
I suggest writing a small HAL for STM32F103 first. It is better documented, the GD32VF is a binary compatible clone. Right now your PR uses F303 HAL which is incompatible, for example, instead of a single GPIO mode register there are two with different fields, so it's not just renaming registers that you have to make it work |
Hi @ekliptik Nice tip! I already made some improvements, however didn't have time to validate and send the new commit containing these improvements and including the board name was fixed. But thanks for the review! |
@kassane looks like some unused parameters are causing the build to fail |
fix |
are you able to confirm that this is how interrupts work on the chip, and is it consistent with other risc chips? |
First, you can't confuse The IRQ mechanism (ECLIC) of this device is unique to the Nuclei manufacturer (core Bumblebee) since RISC-V has no default interrupt mechanism. The SVD provided is also not complete, many complain about certain details like undeclared core timer. Reference |
okay if that's the case then we shouldn't be putting arm interrupt table code in the risc processor code, similar to how we add a skip for the uart example, please add a skip mechanism for the interrupt example. |
🙏 thanks for getting the first riscv patch in! |
Thank you for the patience. 😅 |
* MicroZig Gen 2 interface * Adds ELF patching to handle the checksum requirement --------- Co-authored-by: Felix "xq" Queißner <git@random-projects.net>
Co-authored-by: Felix "xq" Queißner <git@random-projects.net>
* snapshot * size from register properties now passes tests * finish moving to named index types
* snapshot * size from register properties now passes tests * finish moving to named index types
* snapshot * size from register properties now passes tests * finish moving to named index types
References
SVD - Sipeed
GigaDevice device-info
Sipeed -Logan Nano
Manual - Firmware Library (PDF)