Skip to content

Commit

Permalink
Bug Fix usb serial had stopped working
Browse files Browse the repository at this point in the history
  • Loading branch information
sidd-kishan committed Feb 18, 2024
1 parent 533142c commit 4b95056
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 13 deletions.
1 change: 1 addition & 0 deletions build/CMakeFiles/PicoPiFi.dir/compiler_depend.internal
Original file line number Diff line number Diff line change
Expand Up @@ -7057,6 +7057,7 @@ CMakeFiles/PicoPiFi.dir/src/cdc_rndis_device.c.obj
/mnt/c/Users/Aayush/Desktop/PicoPiFi/CherryUSB/common/usb_log.h
/mnt/c/Users/Aayush/Desktop/PicoPiFi/CherryUSB/common/usb_util.h
/mnt/c/Users/Aayush/Desktop/PicoPiFi/CherryUSB/core/usbd_core.h
/mnt/c/Users/Aayush/Desktop/PicoPiFi/CherryUSB/port/rp2040/usb_rp2040_reg.h
/mnt/c/Users/Aayush/Desktop/PicoPiFi/usb_config.h
/usr/include/newlib/_ansi.h
/usr/include/newlib/_newlib_version.h
Expand Down
3 changes: 3 additions & 0 deletions build/CMakeFiles/PicoPiFi.dir/compiler_depend.make
Original file line number Diff line number Diff line change
Expand Up @@ -6917,6 +6917,7 @@ CMakeFiles/PicoPiFi.dir/src/cdc_rndis_device.c.obj: /mnt/c/Users/Aayush/Desktop/
/mnt/c/Users/Aayush/Desktop/PicoPiFi/CherryUSB/common/usb_log.h \
/mnt/c/Users/Aayush/Desktop/PicoPiFi/CherryUSB/common/usb_util.h \
/mnt/c/Users/Aayush/Desktop/PicoPiFi/CherryUSB/core/usbd_core.h \
/mnt/c/Users/Aayush/Desktop/PicoPiFi/CherryUSB/port/rp2040/usb_rp2040_reg.h \
/mnt/c/Users/Aayush/Desktop/PicoPiFi/usb_config.h \
/usr/include/newlib/_ansi.h \
/usr/include/newlib/_newlib_version.h \
Expand Down Expand Up @@ -7507,6 +7508,8 @@ pico-sdk/src/rp2_common/pico_cyw43_driver/cyw43_bus_pio_spi.pio.h:

/mnt/c/Users/Aayush/Desktop/PicoPiFi/pico-sdk/lib/lwip/src/include/lwip/memp.h:

/mnt/c/Users/Aayush/Desktop/PicoPiFi/CherryUSB/port/rp2040/usb_rp2040_reg.h:

/mnt/c/Users/Aayush/Desktop/PicoPiFi/pico-sdk/lib/lwip/src/core/udp.c:

/mnt/c/Users/Aayush/Desktop/PicoPiFi/pico-sdk/lib/lwip/src/include/lwip/mem.h:
Expand Down
Binary file modified build/CMakeFiles/PicoPiFi.dir/src/cdc_rndis_device.c.obj
Binary file not shown.
Binary file modified build/PicoPiFi.bin
Binary file not shown.
6 changes: 3 additions & 3 deletions build/PicoPiFi.dis
Original file line number Diff line number Diff line change
Expand Up @@ -1327,14 +1327,14 @@ Disassembly of section .text:

10000bd8 <usbd_event_handler>:
10000bd8: b510 push {r4, lr}
10000bda: 2807 cmp r0, #7
10000bda: 2907 cmp r1, #7
10000bdc: d000 beq.n 10000be0 <usbd_event_handler+0x8>
10000bde: bd10 pop {r4, pc}
10000be0: 2380 movs r3, #128 ; 0x80
10000be2: 4c0c ldr r4, [pc, #48] ; (10000c14 <usbd_event_handler+0x3c>)
10000be4: 2102 movs r1, #2
10000be4: 011b lsls r3, r3, #4
10000be6: 0022 movs r2, r4
10000be8: 011b lsls r3, r3, #4
10000be8: 3905 subs r1, #5
10000bea: 2000 movs r0, #0
10000bec: f00d fa5e bl 1000e0ac <usbd_ep_start_read>
10000bf0: 2380 movs r3, #128 ; 0x80
Expand Down
Binary file modified build/PicoPiFi.elf
Binary file not shown.
12 changes: 6 additions & 6 deletions build/PicoPiFi.elf.map
Original file line number Diff line number Diff line change
Expand Up @@ -2160,9 +2160,9 @@ Discarded input sections
.bss 0x0000000000000000 0x0 libcherryusblib.a(usbd_cdc.c.obj)
.data 0x0000000000000000 0x0 libcherryusblib.a(usbd_rndis.c.obj)
.data 0x0000000000000000 0x0 libcherryusblib.a(usbd_core.c.obj)
.text 0x0000000000000000 0x0 /tmp/ccRA4lWU.o
.data 0x0000000000000000 0x0 /tmp/ccRA4lWU.o
.bss 0x0000000000000000 0x0 /tmp/ccRA4lWU.o
.text 0x0000000000000000 0x0 /tmp/cc0XDtcV.o
.data 0x0000000000000000 0x0 /tmp/cc0XDtcV.o
.bss 0x0000000000000000 0x0 /tmp/cc0XDtcV.o
.data 0x0000000000000000 0x0 /usr/lib/gcc/arm-none-eabi/10.3.1/thumb/v6-m/nofp/libgcc.a(_dvmd_tls.o)
.bss 0x0000000000000000 0x0 /usr/lib/gcc/arm-none-eabi/10.3.1/thumb/v6-m/nofp/libgcc.a(_dvmd_tls.o)
.text 0x0000000000000000 0x10 /usr/lib/gcc/arm-none-eabi/10.3.1/../../../arm-none-eabi/lib/thumb/v6-m/nofp/libc.a(lib_a-atexit.o)
Expand Down Expand Up @@ -2379,7 +2379,7 @@ LOAD /usr/lib/gcc/arm-none-eabi/10.3.1/../../../arm-none-eabi/lib/thumb/v6-m/nof
.boot2 0x0000000010000000 0x100
0x0000000010000000 __boot2_start__ = .
*(.boot2)
.boot2 0x0000000010000000 0x100 /tmp/ccRA4lWU.o
.boot2 0x0000000010000000 0x100 /tmp/cc0XDtcV.o
0x0000000010000100 __boot2_end__ = .
0x0000000000000001 ASSERT (((__boot2_end__ - __boot2_start__) == 0x100), ERROR: Pico second stage bootloader must be 256 bytes in size)

Expand Down Expand Up @@ -4766,7 +4766,7 @@ LOAD CMakeFiles/PicoPiFi.dir/pico-sdk/src/rp2_common/pico_cyw43_driver/cyw43_dri
LOAD CMakeFiles/PicoPiFi.dir/pico-sdk/src/rp2_common/pico_async_context/async_context_threadsafe_background.c.obj
LOAD CMakeFiles/PicoPiFi.dir/pico-sdk/src/rp2_common/pico_async_context/async_context_base.c.obj
LOAD libcherryusblib.a
LOAD /tmp/ccRA4lWU.o
LOAD /tmp/cc0XDtcV.o
LOAD /usr/lib/gcc/arm-none-eabi/10.3.1/../../../arm-none-eabi/lib/thumb/v6-m/nofp/libstdc++.a
LOAD /usr/lib/gcc/arm-none-eabi/10.3.1/../../../arm-none-eabi/lib/thumb/v6-m/nofp/libm.a
START GROUP
Expand Down Expand Up @@ -4934,7 +4934,7 @@ LOAD linker stubs
.ARM.attributes
0x0000000000000c2a 0x2c libcherryusblib.a(usbd_core.c.obj)
.ARM.attributes
0x0000000000000c56 0x22 /tmp/ccRA4lWU.o
0x0000000000000c56 0x22 /tmp/cc0XDtcV.o
.ARM.attributes
0x0000000000000c78 0x1e /usr/lib/gcc/arm-none-eabi/10.3.1/thumb/v6-m/nofp/libgcc.a(_dvmd_tls.o)
.ARM.attributes
Expand Down
4 changes: 2 additions & 2 deletions build/PicoPiFi.hex
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@
:100BA000F7D18021090153502B002200822100201F
:100BB0000DF0C8F9BBE7C046C8DD0020C8E500203D
:100BC0000818000008100000C8D50020041000001C
:100BD00004080000C8CD002010B5072800D010BDC3
:100BE00080230C4C022122001B0100200DF05EFA34
:100BD00004080000C8CD002010B5072900D010BDC2
:100BE00080230C4C1B012200053900200DF05EFA19
:100BF00080231B01E218032100200DF057FA802307
:100C00005B01E218802304211B0100200DF04EFA45
:100C1000E5E7C046C8CD002010B5930601D1002AF3
Expand Down
Binary file modified build/PicoPiFi.uf2
Binary file not shown.
4 changes: 2 additions & 2 deletions src/cdc_rndis_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ void usbd_rndis_data_recv_done(void)
{
}

void usbd_event_handler(uint8_t event)
void usbd_event_handler(uint8_t busid, uint8_t event)
{
switch (event) {
case USBD_EVENT_RESET:
Expand Down Expand Up @@ -289,7 +289,7 @@ void cdc_rndis_init(uint8_t mac[])
usbd_add_interface(0, (struct usbd_interface *)usbd_cdc_acm_init_intf(0, &intf7));
usbd_add_endpoint(0, &cdc_out_ep4);
usbd_add_endpoint(0, &cdc_in_ep4);
usbd_initialize(0,usb_hw,usbd_event_handler);
usbd_initialize(0,USBCTRL_REGS_BASE,usbd_event_handler);
}

volatile uint8_t dtr_enable = 0;
Expand Down

0 comments on commit 4b95056

Please sign in to comment.