kilograham / b-em

An RP2040 and Raspberry Pi 2/3/4/Zero 2 W version of an opensource BBC Micro emulator originally for Win32 and Linux
http://stardot.org.uk/forums/viewtopic.php?f=4&t=10823
GNU General Public License v2.0
89 stars 12 forks source link

USB Keyboard Build Error #8

Open sharpie7 opened 2 years ago

sharpie7 commented 2 years ago

Thanks for an amazing project. I mentioned this on the star-dot forum, but maybe it was missed.

I am having trouble building the USB support version on a new-installed OS on a Pi4.

Without the USB keyboard it works fine. However, when I try and make with the USB keyboard support added I get this error:

/home/pi/b-em/src/pico/usb_host_hid/usb_host_hid.c:31:10: fatal error: bsp/board.h: No such file or directory
 #include "bsp/board.h"
          ^~~~~~~~~~~~~

Possibly a missing dependency or bad path somewhere? There doesn't seem to be a board.h file in the listed dependencies, so I am guessing the former. Any advice? Thanks.

sharpie7 commented 2 years ago

On further examination, I believe the missing library is tinyusb, but I am not sure how to configure and incorporate it in this project.

sharpie7 commented 2 years ago

Progress of a kind: it seems you need to manually clone tinyusb in to pico-sdk/lib. Then the make finds the tinyusb install. However, there seems to be a version incompatibility problem due to changes in the API. I tried stepping tinyusb back to commit e0aa405 which might be the version this was originally built against, but even that still has problems.

sharpie7 commented 2 years ago

I have updated the code to use the latest tinyusb release and it is working on my Pico. I will do some more tweaks and upload to a GitHub fork in a few days.

sharpie7 commented 2 years ago

I have added an experimental branch on my fork which will build against the new tinyusb API.

NOTE: This version seems to compile OK using the latest 'master' branch of tinyusb as at 2022-01-22 and will run, but does exhibit a number of problems:

The problem with modifier keys is odd and seems to originate in wrong values reported over the tinyusb API. However, I am unable to reproduce it outside of this application so I assume it is an interaction between this app and tinyusb. Either way, I am not currently able to make progress on fixing it. If anyone has expertise to help then please drop me a note.