Complete GS_USB implementation with simplified USB integration

- Implemented complete gs_usb protocol structures and constants
- Added basic USB vendor request handling for gs_usb commands
- Created CAN-FD to gs_usb frame conversion functions
- Fixed deprecated USB API warnings and compilation issues
- Successfully building firmware with 42.6KB flash usage (8.13%)
- Basic framework ready for full gs_usb protocol implementation

Key components:
- gs_usb_can.c/h: CAN interface and protocol structures
- usb_gs_usb_class.c/h: USB class implementation with vendor requests
- All gs_usb protocol constants (BREQ_*, mode flags, feature flags)
- Frame conversion between Zephyr CAN and gs_usb format
- Placeholder for future USB bulk endpoint implementation
This commit is contained in:
2025-12-08 15:18:54 +01:00
parent e0a6b9181e
commit b11c9958e8
24 changed files with 12143 additions and 10273 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -46,10 +46,10 @@ const struct _isr_table_entry __sw_isr_table _sw_isr_table[31] = {
{(const void *)0x0, (ISR)z_irq_spurious}, /* 2 */
{(const void *)0x0, (ISR)z_irq_spurious}, /* 3 */
{(const void *)0x0, (ISR)z_irq_spurious}, /* 4 */
{(const void *)0x8009ba3, (ISR)0x8002261}, /* 5 */
{(const void *)0x8009ba1, (ISR)0x8002261}, /* 6 */
{(const void *)0x8009b9f, (ISR)0x8002261}, /* 7 */
{(const void *)0x0, (ISR)0x8002535}, /* 8 */
{(const void *)0x8009c04, (ISR)0x80022ad}, /* 5 */
{(const void *)0x8009c02, (ISR)0x80022ad}, /* 6 */
{(const void *)0x8009c00, (ISR)0x80022ad}, /* 7 */
{(const void *)0x0, (ISR)0x8002581}, /* 8 */
{(const void *)0x0, (ISR)z_irq_spurious}, /* 9 */
{(const void *)0x0, (ISR)z_irq_spurious}, /* 10 */
{(const void *)0x0, (ISR)z_irq_spurious}, /* 11 */
@@ -62,8 +62,8 @@ const struct _isr_table_entry __sw_isr_table _sw_isr_table[31] = {
{(const void *)0x0, (ISR)z_irq_spurious}, /* 18 */
{(const void *)0x0, (ISR)z_irq_spurious}, /* 19 */
{(const void *)0x0, (ISR)z_irq_spurious}, /* 20 */
{(const void *)0x8008edc, (ISR)0x8002ea9}, /* 21 */
{(const void *)0x8008edc, (ISR)0x8002e1d}, /* 22 */
{(const void *)0x8008f30, (ISR)0x8002ef5}, /* 21 */
{(const void *)0x8008f30, (ISR)0x8002e69}, /* 22 */
{(const void *)0x0, (ISR)z_irq_spurious}, /* 23 */
{(const void *)0x0, (ISR)z_irq_spurious}, /* 24 */
{(const void *)0x0, (ISR)z_irq_spurious}, /* 25 */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -8,9 +8,9 @@ ELF Header:
Type: EXEC (Executable file)
Machine: ARM
Version: 0x1
Entry point address: 0x8001f91
Entry point address: 0x8001fdd
Start of program headers: 52 (bytes into file)
Start of section headers: 1883356 (bytes into file)
Start of section headers: 1905788 (bytes into file)
Flags: 0x5000200, Version5 EABI, soft-float ABI
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
@@ -23,44 +23,44 @@ Section Headers:
[Nr] Name Type Addr Off Size ES Flg Lk Inf Al
[ 0] NULL 00000000 000000 000000 00 0 0 0
[ 1] rom_start PROGBITS 08000000 0000f4 0000bc 00 AX 0 0 4
[ 2] text PROGBITS 080000bc 0001b0 008c40 00 AX 0 0 4
[ 3] .ARM.exidx ARM_EXIDX 08008cfc 008df0 000008 00 AL 2 0 4
[ 4] initlevel PROGBITS 08008d04 008df8 000098 00 A 0 0 4
[ 5] device_area PROGBITS 08008d9c 008e90 000160 00 A 0 0 4
[ 6] sw_isr_table PROGBITS 08008efc 008ff0 0000f8 00 A 0 0 4
[ 7] can_driver_a[...] PROGBITS 08008ff4 0090e8 00005c 00 A 0 0 4
[ 8] gpio_driver_[...] PROGBITS 08009050 009144 000024 00 A 0 0 4
[ 9] reset_driver[...] PROGBITS 08009074 009168 000010 00 A 0 0 4
[10] clock_contro[...] PROGBITS 08009084 009178 00001c 00 A 0 0 4
[11] uart_driver_[...] PROGBITS 080090a0 009194 00001c 00 A 0 0 4
[12] log_const_area PROGBITS 080090bc 0091b0 0000b0 00 A 0 0 4
[13] log_backend_area PROGBITS 0800916c 009260 000010 00 A 0 0 4
[14] tbss NOBITS 0800917c 009270 000004 00 WAT 0 0 4
[15] rodata PROGBITS 0800917c 009270 00137c 00 A 0 0 4
[16] .ramfunc PROGBITS 20000000 00a728 000000 00 W 0 0 1
[17] datas PROGBITS 20000000 00a5ec 000050 00 WA 0 0 4
[18] device_states PROGBITS 20000050 00a63c 000018 00 WA 0 0 1
[19] log_mpsc_pbu[...] PROGBITS 20000068 00a654 000038 00 WA 0 0 4
[20] log_msg_ptr_area PROGBITS 200000a0 00a68c 000004 00 WA 0 0 4
[21] k_heap_area PROGBITS 200000a4 00a690 000014 00 WA 0 0 4
[22] k_sem_area PROGBITS 200000b8 00a6a4 000010 00 WA 0 0 4
[23] usb_descriptor PROGBITS 200000c8 00a6b4 00006f 00 WA 0 0 1
[24] .comment PROGBITS 00000000 00a728 000020 01 MS 0 0 1
[25] .debug_aranges PROGBITS 00000000 00a748 001df8 00 0 0 8
[26] .debug_info PROGBITS 00000000 00c540 109f57 00 0 0 1
[27] .debug_abbrev PROGBITS 00000000 116497 0131f0 00 0 0 1
[28] .debug_line PROGBITS 00000000 129687 03baa4 00 0 0 1
[29] .debug_frame PROGBITS 00000000 16512c 004ae0 00 0 0 4
[30] .debug_str PROGBITS 00000000 169c0c 00d88e 01 MS 0 0 1
[31] .debug_loc PROGBITS 00000000 17749a 039383 00 0 0 1
[32] .debug_ranges PROGBITS 00000000 1b0820 00a088 00 0 0 8
[33] .ARM.attributes ARM_ATTRIBUTES 00000000 1ba8a8 000030 00 0 0 1
[34] .last_section PROGBITS 0800a630 00a724 000004 00 WA 0 0 4
[35] bss NOBITS 20000138 00a728 00113f 00 WA 0 0 8
[36] noinit NOBITS 20001278 00a728 004000 00 WA 0 0 8
[37] .symtab SYMTAB 00000000 1ba8d8 009390 10 38 1276 4
[38] .strtab STRTAB 00000000 1c3c68 007e83 00 0 0 1
[39] .shstrtab STRTAB 00000000 1cbaeb 0001f1 00 0 0 1
[ 2] text PROGBITS 080000bc 0001b0 008c94 00 AX 0 0 4
[ 3] .ARM.exidx ARM_EXIDX 08008d50 008e44 000008 00 AL 2 0 4
[ 4] initlevel PROGBITS 08008d58 008e4c 000098 00 A 0 0 4
[ 5] device_area PROGBITS 08008df0 008ee4 000160 00 A 0 0 4
[ 6] sw_isr_table PROGBITS 08008f50 009044 0000f8 00 A 0 0 4
[ 7] can_driver_a[...] PROGBITS 08009048 00913c 00005c 00 A 0 0 4
[ 8] gpio_driver_[...] PROGBITS 080090a4 009198 000024 00 A 0 0 4
[ 9] reset_driver[...] PROGBITS 080090c8 0091bc 000010 00 A 0 0 4
[10] clock_contro[...] PROGBITS 080090d8 0091cc 00001c 00 A 0 0 4
[11] uart_driver_[...] PROGBITS 080090f4 0091e8 00001c 00 A 0 0 4
[12] log_const_area PROGBITS 08009110 009204 0000b0 00 A 0 0 4
[13] log_backend_area PROGBITS 080091c0 0092b4 000010 00 A 0 0 4
[14] tbss NOBITS 080091d0 0092c4 000004 00 WAT 0 0 4
[15] rodata PROGBITS 080091d0 0092c4 001388 00 A 0 0 4
[16] .ramfunc PROGBITS 20000000 00a788 000000 00 W 0 0 1
[17] datas PROGBITS 20000000 00a64c 000050 00 WA 0 0 4
[18] device_states PROGBITS 20000050 00a69c 000018 00 WA 0 0 1
[19] log_mpsc_pbu[...] PROGBITS 20000068 00a6b4 000038 00 WA 0 0 4
[20] log_msg_ptr_area PROGBITS 200000a0 00a6ec 000004 00 WA 0 0 4
[21] k_heap_area PROGBITS 200000a4 00a6f0 000014 00 WA 0 0 4
[22] k_sem_area PROGBITS 200000b8 00a704 000010 00 WA 0 0 4
[23] usb_descriptor PROGBITS 200000c8 00a714 00006f 00 WA 0 0 1
[24] .comment PROGBITS 00000000 00a788 000020 01 MS 0 0 1
[25] .debug_aranges PROGBITS 00000000 00a7a8 001e20 00 0 0 8
[26] .debug_info PROGBITS 00000000 00c5c8 10e271 00 0 0 1
[27] .debug_abbrev PROGBITS 00000000 11a839 01325c 00 0 0 1
[28] .debug_line PROGBITS 00000000 12da95 03c484 00 0 0 1
[29] .debug_frame PROGBITS 00000000 169f1c 004b4c 00 0 0 4
[30] .debug_str PROGBITS 00000000 16ea68 00d93d 01 MS 0 0 1
[31] .debug_loc PROGBITS 00000000 17c3a5 039a67 00 0 0 1
[32] .debug_ranges PROGBITS 00000000 1b5e10 00a1d8 00 0 0 8
[33] .ARM.attributes ARM_ATTRIBUTES 00000000 1bffe8 000030 00 0 0 1
[34] .last_section PROGBITS 0800a690 00a784 000004 00 WA 0 0 4
[35] bss NOBITS 20000138 00a788 001140 00 WA 0 0 8
[36] noinit NOBITS 20001278 00a788 004000 00 WA 0 0 8
[37] .symtab SYMTAB 00000000 1c0018 0093d0 10 38 1279 4
[38] .strtab STRTAB 00000000 1c93e8 007ea1 00 0 0 1
[39] .shstrtab STRTAB 00000000 1d1289 0001f1 00 0 0 1
Key to Flags:
W (write), A (alloc), X (execute), M (merge), S (strings), I (info),
L (link order), O (extra OS processing required), G (group), T (TLS),
@@ -69,12 +69,12 @@ Key to Flags:
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
EXIDX 0x008df0 0x08008cfc 0x08008cfc 0x00008 0x00008 R 0x4
LOAD 0x0000f4 0x08000000 0x08000000 0x0a4f8 0x0a4f8 RWE 0x4
LOAD 0x00a5ec 0x20000000 0x0800a4f8 0x00137 0x00137 RW 0x4
LOAD 0x00a724 0x0800a630 0x0800a630 0x00004 0x00004 RW 0x4
EXIDX 0x008e44 0x08008d50 0x08008d50 0x00008 0x00008 R 0x4
LOAD 0x0000f4 0x08000000 0x08000000 0x0a558 0x0a558 RWE 0x4
LOAD 0x00a64c 0x20000000 0x0800a558 0x00137 0x00137 RW 0x4
LOAD 0x00a784 0x0800a690 0x0800a690 0x00004 0x00004 RW 0x4
LOAD 0x000000 0x20000138 0x20000138 0x00000 0x05140 RW 0x8
TLS 0x009270 0x0800917c 0x0800917c 0x00000 0x00004 R 0x4
TLS 0x0092c4 0x080091d0 0x080091d0 0x00000 0x00004 R 0x4
Section to Segment mapping:
Segment Sections...

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff