Ryzer, Thank you for your suggestions. I will try the update for the device tree, but with otg as value, the board will be a storage device for my dashcam.
I am trying to get a Buster release with kernel 6.6.75 to compile under armbian build, but so far, the compilation fails because there is no availale package for base-files. I did put the file in the cache/sources folder (which worked for a bullseye version), but nothing works for the buster version.
So far, the biggest progress was achieved by commenting out or adding the following in armbianEnv.txt (no updates in modules.conf, config.txt or cdmline.txt). With those updates, the drive and folders show up instantly upon activating hte gadget, I can navigate the folders, but writing is a hit and miss (using libcomposite, not g_mass_storage)
#overlay_prefix=sun7i-a20
param_usb_device_mode=otg
overlays=dwc2 (instead of the usual dtoverlays)
With those parameters, Windows file explorer and Windows Explorer no longer crash.
The top command shows 13% CPU usage for a kworker process related to power. A google search found that this may be due to a device/driver continuously requesting a power state change (conflict between drivers?).
No errors in dmesg regarding dwc2. Here are the final line:
[ 75.627225] loop0: detected capacity change from 0 to 83886080
[ 75.628674] loop0: p1
[ 76.067022] loop0: detected capacity change from 0 to 83884032
[ 76.519886] FS-Cache: Loaded
[ 76.784125] Key type cifs.spnego registered
[ 76.784185] Key type cifs.idmap registered
[ 76.787080] CIFS: Attempting to mount //192.168.0.1/Tesladrive
[ 76.893017] CIFS: decode_ntlmssp_challenge: authentication has been weakened as server does not support key exchange
[ 78.023297] loop0: detected capacity change from 0 to 83886080
[ 78.023757] loop0: p1
[ 78.568262] loop0: detected capacity change from 0 to 83884032
[ 79.642716] Mass Storage Function, version: 2009/09/11
[ 79.642755] LUN: removable file: (no medium)
and usb related lines:
[ 4.097675] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[ 4.097739] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 5
[ 4.115390] usb usb5: Manufacturer: Linux 6.6.75-legacy-sunxi musb-hcd
[ 4.115403] usb usb5: SerialNumber: musb-hdrc.1.auto
[ 20.084995] systemd[1]: Reached target usb-gadget.target - Hardware activated USB gadget.