Skip to content
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

RP2040 PR branch support #17115

Closed
tzarc opened this issue May 16, 2022 · 16 comments · Fixed by #14877
Closed

RP2040 PR branch support #17115

tzarc opened this issue May 16, 2022 · 16 comments · Fixed by #14877

Comments

@tzarc
Copy link
Member

tzarc commented May 16, 2022

Placeholder for issues/discussion with the RP2040 PR #14877.

@tzarc tzarc linked a pull request May 16, 2022 that will close this issue
35 tasks
@zvecr zvecr pinned this issue May 16, 2022
@Jpe230
Copy link
Contributor

Jpe230 commented May 17, 2022

Meta-question: Would it be viable to open a discord channel specific to RP2040 to enable a more informal discussion?

@freznel10
Copy link

I'm encountering some primary/secondary issues. Have setup a split hand pin and I know it works since the OLEDs show what's supposed to be displayed on the right and left sides. Same goes with the split pointers--they behave according to what I've setup for the right and left pointers no matter which side I connect. But no matter what I do, when I connect to left split, the matrix is inverted.

@doesntfazer
Copy link
Contributor

When trying to compile a via(l) keymap I created, I am getting this error. I turned off basically everything in rules.mk. I am aware that there isn't an EEPROM or EEPROM emulation yet, but I thought it meant that it wouldn't persist, but you could still build it.

Compiling: quantum/dynamic_keymap.c quantum/dynamic_keymap.c:88:1: error: static assertion failed: "Dynamic keymaps are configured to use more EEPROM than is available."
88 | _Static_assert((DYNAMIC_KEYMAP_EEPROM_MAX_ADDR) - (DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR) >= 100, "Dynamic keymaps are configured to use more EEPROM than is available.");
| ^~~~~~~~~~~~~~
[ERRORS]
|
|
|
make[1]: *** [builddefs/common_rules.mk:452: .build/obj_crowboard_via/quantum/dynamic_keymap.o] Error 1
make: *** [Makefile:418: crowboard:via] Error 1
Make finished with errors

@Jpe230
Copy link
Contributor

Jpe230 commented May 17, 2022

When trying to compile a via(l) keymap I created, I am getting this error. I turned off basically everything in rules.mk. I am aware that there isn't an EEPROM or EEPROM emulation yet, but I thought it meant that it wouldn't persist, but you could still build it.

Compiling: quantum/dynamic_keymap.c quantum/dynamic_keymap.c:88:1: error: static assertion failed: "Dynamic keymaps are configured to use more EEPROM than is available."

88 | _Static_assert((DYNAMIC_KEYMAP_EEPROM_MAX_ADDR) - (DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR) >= 100, "Dynamic keymaps are configured to use more EEPROM than is available.");

| ^~~~~~~~~~~~~~

[ERRORS]

|

|

|

make[1]: *** [builddefs/common_rules.mk:452: .build/obj_crowboard_via/quantum/dynamic_keymap.o] Error 1

make: *** [Makefile:418: crowboard:via] Error 1

Make finished with errors

Try increasing TRANSIENT_EEPROM_SIZE and enable the fake EEPROM driver if you haven't: EEPROM_DRIVER = transient

@doesntfazer
Copy link
Contributor

When trying to compile a via(l) keymap I created, I am getting this error. I turned off basically everything in rules.mk. I am aware that there isn't an EEPROM or EEPROM emulation yet, but I thought it meant that it wouldn't persist, but you could still build it.
Compiling: quantum/dynamic_keymap.c quantum/dynamic_keymap.c:88:1: error: static assertion failed: "Dynamic keymaps are configured to use more EEPROM than is available."
88 | _Static_assert((DYNAMIC_KEYMAP_EEPROM_MAX_ADDR) - (DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR) >= 100, "Dynamic keymaps are configured to use more EEPROM than is available.");
| ^~~~~~~~~~~~~~
[ERRORS]
|
|
|
make[1]: *** [builddefs/common_rules.mk:452: .build/obj_crowboard_via/quantum/dynamic_keymap.o] Error 1
make: *** [Makefile:418: crowboard:via] Error 1
Make finished with errors

Try increasing TRANSIENT_EEPROM_SIZE and enable the fake EEPROM driver if you haven't: EEPROM_DRIVER = transient

That ended up working. Thank you.

@jaygreco
Copy link
Contributor

jaygreco commented May 30, 2022

I'm seeing some issues with a custom RP2040 board that uses this 4MB flash chip. I can flash the rp2040 onekey UF2 but it doesn't boot to the USB stack, whereas I can get the board I have with a Winbond 25Q128JVSQ to boot no problem with the same UF2. The BY25Q32BSTIG board works using the Ardiono RP2040 with the following settings, so I know it's okay hardware-wise:
image

BTW, beyond stoked to retire the legacy Bit-C in favor of an RP2040 flavor 🙏

@sigprof
Copy link
Contributor

sigprof commented May 30, 2022

Arduino settings for the “Generic RP2040” board contain:

generic.build.boot2=boot2_generic_03h_4_padded_checksum

The Raspberry Pi Pico board uses boot2_w25q080_2_padded_checksum instead.

In the QMK port code for RP2040 the second stage bootloader is provided as a C array with precompiled code — see platforms/chibios/RP/stage2_bootloaders.c. The default bootloader is apparently for the W25Q080 chip (the comments in the bootloader source say that it also supports W25Q16JV, AT25SF081, S25FL132K0), but there are also two other versions which you can select by defining either RP2040_FLASH_AT25SF128A or RP2040_FLASH_GD25Q64CS in config.h. However, the generic_03h bootloader variant seems to be missing there (and apparently pico-sdk also has the w25x10cl variant, which is not present too).

For BY25Q32BSTIG you may try using #define RP2040_FLASH_AT25SF128A (apparently one difference between the AT25SF128A and W25Q080 bootloaders is that the W25Q080 bootloader sets the QE bit in SR2 by performing a two-byte write to SR1 (which then continues to SR2 on those chips), but the BY25Q32BSTIG datasheet specifies that its status register write commands support only a single data byte; the AT25SF128A bootloader uses a single byte write to SR2 at that place). If that does not work, adding the last resort generic_03h bootloader would probably be required (note that it would also result in a noticeable slowdown in comparison to a proper QSPI XIP mode).

@jaygreco
Copy link
Contributor

@sigprof Thanks for the fantastic deep dive. Second-stage bootloader seems like an obvious place to look, in retrospect. I'll test the other bootloader options, but I think it's probably safe to say this is the issue. I need to do some more research the different boot modes and figure out how the code running on my test boards is performing depending on the flash part used.

Out of curiosity, does anyone know why the generic_03h and w25x10cl bootloader options aren't present in the QMK bootcode?

@KarlK90
Copy link
Member

KarlK90 commented May 31, 2022

Out of curiosity, does anyone know why the generic_03h and w25x10cl bootloader options aren't present in the QMK bootcode?

They are now with the latest commits to the rp2040 branch just select one of the defines, the fallback is always a W25Q080 flash chip.

#define RP2040_FLASH_AT25SF128A
#define RP2040_FLASH_GD25Q64CS
#define RP2040_FLASH_W25X10CL
#define RP2040_FLASH_GENERIC_03H
#define RP2040_FLASH_IS25LP080

@bschwehn
Copy link

bschwehn commented Jun 16, 2022

I've setup a Fifi (split keyboard, using crkbd settings for the most part) and noticed that on the secondary side, some key presses were not registered. The console log showed the error "USART: Handshake failed". I switched to a different TRRS cable and have not seen the issue since. The cable showing the issue works fine with the pro micros.

I guess this is related to the weaker pull ups and looks like KarlK90 did some great work to make it work at all, so I'm not complaining, just wanted to mention it in case someone else is running into this issue.

Edit: maybe it's not the cable. It seemed to be working for a while and than gave the same errors.
I had a quick look with a oscilloscope. The signal looks ok to me, but to be honest, not sure what exactly I am looking for.

Reducing the speed with
#define SERIAL_USART_SPEED 57600

seems to help, still need to watch it for a while.

Edit 2: it appears the error went away after disabling OLED display

@masiullah
Copy link

I took the most recent code for compiling the firmware and getting the below error

Compiling: quantum/keymap_introspection.c quantum/keymap_introspection.c: In function 'keymap_layer_count':
quantum/keymap_introspection.c:9:45: error: 'keymaps' undeclared (first use in this function)
9 | #define NUM_KEYMAP_LAYERS ((uint8_t)(sizeof(keymaps) / ((MATRIX_ROWS) * (MATRIX_COLS) * sizeof(uint16_t))))

I can think it might be due to the change #17229

When I remove the code at line 398 in build_keyboard.mk then it works. Is there something I am missing that I need to do to make this work without build_keyboard changes. I am using userspace keymaps and overriding it in the keymap using USER_NAME :=

line 398 in build_keyboard.mk
$(QUANTUM_DIR)/keymap_introspection.c \

@YCF
Copy link
Contributor

YCF commented Jul 13, 2022

How to make the ADC working?
I'm adding the joystick to my keyboard.

@tzarc
Copy link
Member Author

tzarc commented Jul 13, 2022

How to make the ADC working? I'm adding the joystick to my keyboard.

Unsupported on RP2040 at the moment.

@YCF
Copy link
Contributor

YCF commented Jul 13, 2022

How to make the ADC working? I'm adding the joystick to my keyboard.

Unsupported on RP2040 at the moment.

ETA?

@KarlK90
Copy link
Member

KarlK90 commented Jul 13, 2022

No ETA.

@zvecr zvecr unpinned this issue Aug 28, 2022
@zvecr
Copy link
Member

zvecr commented Aug 28, 2022

Supported merged in 2022q3

@zvecr zvecr closed this as completed Aug 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.