Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rp2040/raspberrypi-pico-w: update submodule to avoid invaild firmware #8439

Merged
merged 6 commits into from
Feb 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion arch/arm/src/common/arm_backtrace_unwind.c
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ int up_backtrace(struct tcb_s *tcb,
# ifdef CONFIG_SMP
frame.stack_top = arm_intstack_top();
# else
frame.stack_top = &g_intstacktop;
frame.stack_top = (unsigned long)&g_intstacktop;
# endif /* CONFIG_SMP */
#endif /* CONFIG_ARCH_INTERRUPTSTACK > 7 */

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/src/rp2040/boot2/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ $(BOOT_STAGE2).bin: %.bin: %.elf
$(BOOT_STAGE2).elf: $(BOOT2SRC)
$(Q) touch $(PICO_SDK_PATH)/src/common/pico_base/include/pico/version.h
$(Q) touch $(PICO_SDK_PATH)/src/common/pico_base/include/pico/config_autogen.h
$(CC) -nostdlib $(ARCHSCRIPT) $(BOOT2CFLAGS) -o $@ $<
$(CC) -nostdlib -T$(ARCHSCRIPT) $(BOOT2CFLAGS) -o $@ $<
$(DELFILE) $(PICO_SDK_PATH)/src/common/pico_base/include/pico/version.h
$(DELFILE) $(PICO_SDK_PATH)/src/common/pico_base/include/pico/config_autogen.h

Expand Down
6 changes: 4 additions & 2 deletions boards/arm/rp2040/raspberrypi-pico-w/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ There is currently no direct user mode access to these RP2040 hardware features:
Installation
============

1. Download Raspberry Pi Pico SDK
1. Download Raspberry Pi Pico SDK and update submodule(cyw43-driver)

$ git clone -b 1.1.2 https://github.com/raspberrypi/pico-sdk.git
$ git clone -b 1.4.0 https://github.com/raspberrypi/pico-sdk.git
$ cd pico-sdk
$ git submodule update --init --recursive lib/cyw43-driver

2. Set PICO_SDK_PATH environment variable

Expand Down
24 changes: 23 additions & 1 deletion boards/arm/rp2040/raspberrypi-pico-w/configs/telnet/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,34 @@ CONFIG_ARCH_BOARD="raspberrypi-pico-w"
CONFIG_ARCH_BOARD_RASPBERRYPI_PICO_W=y
CONFIG_ARCH_CHIP="rp2040"
CONFIG_ARCH_CHIP_RP2040=y
CONFIG_ARCH_INTERRUPTSTACK=2048
CONFIG_ARCH_RAMVECTORS=y
CONFIG_ARCH_STACKDUMP=y
CONFIG_BOARDCTL_RESET=y
CONFIG_BOARD_LOOPSPERMSEC=10450
CONFIG_BUILTIN=y
CONFIG_DEBUG_ASSERTIONS=y
CONFIG_DEBUG_ERROR=y
CONFIG_DEBUG_FEATURES=y
CONFIG_DEBUG_FULLOPT=y
CONFIG_DEBUG_SYMBOLS=y
CONFIG_DISABLE_POSIX_TIMERS=y
CONFIG_DRIVERS_IEEE80211=y
CONFIG_DRIVERS_WIRELESS=y
CONFIG_EXAMPLES_HELLO=y
CONFIG_FS_PROCFS=y
CONFIG_FS_PROCFS_REGISTER=y
CONFIG_IEEE80211_BROADCOM_DEFAULT_COUNTRY="XX"
CONFIG_IEEE80211_BROADCOM_DMABUF_ALIGNMENT=16
CONFIG_IEEE80211_BROADCOM_FRAME_POOL_SIZE=32
CONFIG_IEEE80211_BROADCOM_FULLMAC_GSPI=y
CONFIG_IEEE80211_INFINEON_CYW43439=y
CONFIG_INIT_ENTRYPOINT="nsh_main"
CONFIG_IOB_NBUFFERS=196
CONFIG_IOB_NCHAINS=24
CONFIG_LIBC_FLOATINGPOINT=y
CONFIG_MM_BACKTRACE=0
CONFIG_NDEBUG=y
CONFIG_NET=y
CONFIG_NETDB_DNSCLIENT=y
CONFIG_NETDB_DNSCLIENT_RECV_TIMEOUT=3
Expand All @@ -50,6 +62,7 @@ CONFIG_NET_ICMP_SOCKET=y
CONFIG_NET_LOOPBACK=y
CONFIG_NET_LOOPBACK_PKTSIZE=1024
CONFIG_NET_TCP=y
CONFIG_NET_TCP_DELAYED_ACK=y
CONFIG_NET_UDP=y
CONFIG_NSH_ARCHINIT=y
CONFIG_NSH_BUILTIN_APPS=y
Expand All @@ -58,19 +71,28 @@ CONFIG_RAM_SIZE=270336
CONFIG_RAM_START=0x20000000
CONFIG_READLINE_CMD_HISTORY=y
CONFIG_RR_INTERVAL=200
CONFIG_SCHED_BACKTRACE=y
CONFIG_SCHED_HPWORK=y
CONFIG_SCHED_LPWORK=y
CONFIG_SCHED_WAITPID=y
CONFIG_STACK_COLORATION=y
CONFIG_START_DAY=9
CONFIG_START_MONTH=2
CONFIG_START_YEAR=2021
CONFIG_SYSLOG_CONSOLE=y
CONFIG_SYSLOG_BUFFER=y
CONFIG_SYSLOG_INTBUFFER=y
CONFIG_SYSLOG_INTBUFSIZE=2048
CONFIG_SYSLOG_PROCESSID=y
CONFIG_SYSTEM_DHCPC_RENEW=y
CONFIG_SYSTEM_DUMPSTACK=y
CONFIG_SYSTEM_NSH=y
CONFIG_SYSTEM_PING=y
CONFIG_SYSTEM_TELNET_CLIENT=y
CONFIG_TESTING_GETPRIME=y
CONFIG_TESTING_OSTEST=y
CONFIG_TTY_FORCE_PANIC=y
CONFIG_TTY_SIGINT=y
CONFIG_TTY_SIGTSTP=y
CONFIG_UART0_SERIAL_CONSOLE=y
CONFIG_WIRELESS_WAPI=y
CONFIG_WIRELESS_WAPI_CMDTOOL=y
Expand Down
54 changes: 19 additions & 35 deletions drivers/wireless/ieee80211/bcm43xxx/bcmf_gspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,6 @@ static int bcmf_gspi_thread(int argc, char **argv)
uint16_t intr_flags;
int ret;
int length;
int wait_count = 0;
bool wait_for_event;
bool enter_low_power = false;

Expand Down Expand Up @@ -424,7 +423,10 @@ static int bcmf_gspi_thread(int argc, char **argv)

/* If we don't have a frame leave the loop */

if (length == 0) break;
if (length == 0)
{
break;
}

/* Read and process frame. This updates gspi->status */

Expand All @@ -436,56 +438,35 @@ static int bcmf_gspi_thread(int argc, char **argv)
}
else
{
wlerr("error reading f2 frame: %d\n", ret);
wlwarn("error reading f2 frame: %d\n", ret);
}
}
else

if (wait_for_event)
{
/* If we don't have anything to read, try sending a packet */
/* Send the frame */

while ((status & CYW_REG_STATUS_F2_RECEIVE_RDY) == 0)
do
{
/* Oops! no room for a packet. We'll wait a bit to see
* if room shows up.
*/

wlinfo(">>>> not ready to receive\n");

if (++wait_count > 100)
{
wlerr("Chip cannot receive F2 frame\n");
break;
}

/* No room at the inn for an f2 frame -- wait a bit */

usleep(10000);

ret = bcmf_gspi_send_f2_frame(priv);
status = bcmf_gspi_read_reg_32(gspi,
gspi_f0_bus,
CYW_REG_STATUS);
gspi_f0_bus, CYW_REG_STATUS);
}

/* reset the count for next time */

wait_count = 0;

/* We have space, send the frame */

ret = bcmf_gspi_send_f2_frame(priv);
while (ret == OK && (status & CYW_REG_STATUS_F2_RECEIVE_RDY));

if (ret == OK)
{
wait_for_event = false;
}
else
{
#ifdef CONFIG_DEBUG_WIRELESS_ERROR
if (ret != -ENODATA)
{
#ifdef CONFIG_DEBUG_WIRELESS_ERROR
wlerr("error sending f2 frame: %d\n", ret);
}
#endif
nxsig_usleep(10 * 1000);
}
}
}

Expand All @@ -511,7 +492,10 @@ static int bcmf_gspi_thread(int argc, char **argv)
&gbus->thread_signal,
BCMF_GSPI_LOWPOWER_TIMEOUT_TICK);

if (ret == -ETIMEDOUT) enter_low_power = true;
if (ret == -ETIMEDOUT)
{
enter_low_power = true;
}
}
}
}
Expand Down
7 changes: 4 additions & 3 deletions drivers/wireless/ieee80211/bcm43xxx/bcmf_gspi_f2_frame.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

#include <nuttx/config.h>
#include <nuttx/compiler.h>
#include <nuttx/signal.h>

#include <debug.h>
#include <errno.h>
Expand All @@ -40,7 +41,7 @@
#include "bcmf_bdc.h"
#include "bcmf_utils.h"

#include "bcmf_netdev.h"
#include "bcmf_netdev.h"

#include "bcmf_sdio_regs.h"

Expand Down Expand Up @@ -327,8 +328,8 @@ int bcmf_gspi_send_f2_frame(FAR struct bcmf_dev_s *priv)
{
/* TODO handle this case */

wlerr("No credit to send frame\n");
return -EAGAIN;
wlwarn("No credit to send frame\n");
nxsig_usleep(10 * 1000);
}

if (nxmutex_lock(&gbus->queue_lock) < 0)
Expand Down
9 changes: 4 additions & 5 deletions drivers/wireless/ieee80211/bcm43xxx/bcmf_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ void bcmf_interface_free_frame(FAR struct bcmf_dev_s *priv,

bcmf_interface_frame_t
*bcmf_interface_allocate_frame(FAR struct bcmf_dev_s *priv,
bool block,
bool tx)
bool block, bool tx)
{
FAR bcmf_interface_dev_t *ibus = (FAR bcmf_interface_dev_t *) priv->bus;
bcmf_interface_frame_t *iframe;
Expand Down Expand Up @@ -122,13 +121,13 @@ bcmf_interface_frame_t

nxmutex_unlock(&ibus->queue_lock);

nxsig_usleep(10 * 1000);

if (!block)
{
wlinfo("No avail buffer\n");
wlwarn("No avail buffer\n");
return NULL;
}

nxsig_usleep(10 * 1000);
}

#if defined(CONFIG_IEEE80211_BROADCOM_FULLMAC_GSPI)
Expand Down
Loading