zephyriot / zep-jira14

0 stars 0 forks source link

SPI fails on Nucleo_f334r8 #2250

Open nashif opened 7 years ago

nashif commented 7 years ago

Reported by Erwan Gouriou:

tests/drivers/spi/spi_loopback fails on nucleo_f334r8.

bus error: (irq & poll) Faulting instruction address: 0x8001f0e (drivers/spi/spi_context.h:229) Imprecise data bus error Fatal fault in ISR! Spinning...

Following part of code is pointed: drivers/spi/spi_context.h: {code:java} void spi_context_update_tx(struct spi_context *ctx, u8_t dfs) { if (!ctx->tx_len) { return; }

ctx->tx_len--;
if (!ctx->tx_len) {
    ctx->current_tx++;
    ctx->tx_count--;


Issue lies since introduction of SPI LL Based driver.
Not a regression since there was no SPI driver for STM32F3 based socs before that.

Issue remains with mbolivar rework of driver:
https://github.com/zephyrproject-rtos/zephyr/pull/832

(Imported from Jira ZEP-2419)
nashif commented 7 years ago

by Mark Linkmeyer:

Anas Nashif , who owns this driver so it can be assigned to them to fix? Thx.

nashif commented 7 years ago

by Marti Bolivar:

Erwan Gouriou , since the bus error is imprecise, the code which caused the fault could be elsewhere, no?

Mark Linkmeyer , Anas Nashif , maybe the STM32F3 family maintainer should be the owner, since the driver appears to work well (now) on other STM32 families?

nashif commented 7 years ago

by Erwan Gouriou:

Marti Bolivar, I fully agree that faulty code should be elsewhere. I just outlined this code as pointed by debugger and copy/pasted it as a start for further analysis. I'm not saying this code is suspect.

I assigned the point to myself, but I won't have time to look at it before September

nashif commented 7 years ago

by Yannis Damigos:

I get a similar issue while I am trying to add I2C support on stm32f3_disco board. Below are the information I managed to collect. It just hangs after the line 41 of i2c_ll_stm32_v2.c. It does not output any SYS_LOG on console.

prj.conf:

{code:java} CONFIG_SYS_LOG=y
CONFIG_SYS_LOG_DEFAULT_LEVEL=4 CONFIG_SYS_LOG_OVERRIDE_LEVEL=4

CONFIG_SYS_LOG_I2C_LEVEL=4

CONFIG_STDOUT_CONSOLE=y CONFIG_PRINTK=y CONFIG_GPIO=y CONFIG_I2C=y CONFIG_I2C_STM32_INTERRUPT=y CONFIG_DEBUG=y


openocd debugserver output:

{code:java}
Info : halted: PC: 0x08000b98                                                                                     
Info : halted: PC: 0x08000afc                                                                                     
Info : halted: PC: 0x00000000      

gdb output:

{code:java} (gdb) next
41 LL_I2C_SetTransferRequest(i2c, transfer);
(gdb) next
0x00000000 in ?? ()
(gdb) bt --full
No symbol "full" in current context.
(gdb) bt full

0 0x00000000 in ?? ()

No symbol table info available. Backtrace stopped: previous frame identical to this frame (corrupt stack?) (gdb) info frame
Stack level 0, frame at 0x0:
pc = 0x0; saved pc = Outermost frame: previous frame identical to this frame (corrupt stack?) Arglist at unknown address. Locals at unknown address, Previous frame's sp is 0x0 (gdb) info registers
r0 0x0 0
r1 0x0 0
r2 0x0 0
r3 0x0 0
r4 0x0 0
r5 0x0 0
r6 0x0 0
r7 0x0 0
r8 0x0 0
r9 0x0 0
r10 0x0 0
r11 0x0 0
r12 0x0 0
sp 0x0 0x0
lr 0x0 0
pc 0x0 0x0
xPSR 0x0 0