ZOOM R16/24 support in experimental branch


#1

Hi,

I am trying to include ZOOM R16/24 USB host support for axoloti experimental branch.
Object file can be build, but I think it is not linked.
Which switch do I need to enable during build to have HAL_USE_USBH := TRUE and HAL_USBH_USE_ADDITIONAL_CLASS_DRIVERS := TRUE?
The changes in firmware/axoloti_defines.h doesn't seems to work.
What am I doing wrong?

I have done the following changes:

firmware/Makefile:
--- a/firmware/Makefile
+++ b/firmware/Makefile
@@ -234,6 +234,7 @@ CSRC = $(STARTUPSRC) \
${FIRMWARE}/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c \
${FIRMWARE}/usbh_midi_class.c \
${FIRMWARE}/usbh_virus_class.c \
+ ${FIRMWARE}/usbh_zoom_class.c \
${FIRMWARE}/usbh_conf.c \
${FIRMWARE}/serial_midi.c \
${FIRMWARE}/spilink.c \
~


firmware/axoloti_defines.h
--- a/firmware/axoloti_defines.h
+++ b/firmware/axoloti_defines.h
@@ -34,4 +34,7 @@ typedef int32_t int32buffer[BUFSIZE];
#define FWVERSION3 0
#define FWVERSION4 1

+#define HAL_USE_USBH TRUE
+#define HAL_USBH_USE_ADDITIONAL_CLASS_DRIVERS TRUE
+
#endif


firmware/usbh_additional_class_drivers.h
--- a/firmware/usbh_additional_class_drivers.h
+++ b/firmware/usbh_additional_class_drivers.h
@@ -18,19 +18,20 @@
#include "hal_usbh.h"
#include "usbh_midi_class.h"

-#if HAL_USE_USBH && HAL_USBH_USE_ADDITIONAL_CLASS_DRIVERS
+/*#if HAL_USE_USBH && HAL_USBH_USE_ADDITIONAL_CLASS_DRIVERS*/

/* Declarations */
extern const usbh_classdriverinfo_t usbhMidiClassDriverInfo;
extern const usbh_classdriverinfo_t usbhVirusClassDriverInfo;
+extern const usbh_classdriverinfo_t usbhZoomClassDriverInfo;

/* Comma separated list of additional class drivers */
#define HAL_USBH_ADDITIONAL_CLASS_DRIVERS \
- &usbhMidiClassDriverInfo, &usbhVirusClassDriverInfo,
+ &usbhMidiClassDriverInfo, &usbhVirusClassDriverInfo, &usbhZoomClassDriverInfo,

-#endif
+/*#endif*/

#endif /* USBH_ADDITIONAL_H_ */


and added
firmware/usbh_zoom_class.c
looks quite like the virus one.

Thanks.


#2

you dont need to define it, its already defined as true in halconf_community.h

note: ive not had time to spend on this recently, but back in September, I got the virus working successfully.
so id hope/assume that has not changed... i.e. you will not need to 'enable' anything, just add your class.


#3

Hi @thetechnobear,

thank you for fast reply. May be I am doing s.th. other wrong. Is there a kind of make menuconfig to configure Axoloti firmware?


#4

nope...

you should just need to add to the firmware makefile, then you add you 'driver class' to that list, then the load function gets called which provides the various ids to find the device.

what makes you think its not linked?
is your init/load not getting called? (that'd be the first thing id check)

sorry, cant get to a machine with axo at the moment.... but assuming nothing odd has change since when I last tried, it should be fairly straightforward (as far as i remember :wink: )

EDIT: just one important note... as you have seen the framework is completely different to 1.0.12, so dont assume because something worked in 1.0.12 it will work here... we actually found quite a few (low level) oddities back in September, which caused some odd issues with some devices, but others were perfectly fine.
I think in the end it was pretty stable, but it was not all plain sailing :wink:


#5

I added debug outputs in several stages, where I thought the code would be called. But nothing had been printed out.
To be able to build the code successfully it was a long way on Ubuntu Studio. I have to double check the compiler messages...


#6

IIRC there were quite a few warnings.
What i would do first, is check the firmware is working as you expect with a usb class compliant device ..: just in case it’s something unrelated to your code
Are you using an stlink? It’s the most reliable way to get the trace output etc.


#7

Unfortunately, I don't have access to a real debugger. I am using uinfof().


#8

uinfof() is currently outputting in serial on gpio PA2, you need a TTL-serial cable to read it.
Modifying the usb-host code to dump diagnostics to the axoloti main window over USB is pretty high on my todo list.


#9

Ah, that is why I can't see anything in axoloti main window. 115200 8N1 for serial communication?


#10

yes, 115200 8N1, transmitting on PA2