Skip to content

Conversation

sjanc
Copy link
Contributor

@sjanc sjanc commented Oct 9, 2023

Default stack size if not enought and was causing MPU faults. This was affecting GATT/SR/GAW/BV-14-C qualification test case.

bttester_gatt: gatt_db_add: handle 0x0000
os: ***** MPU FAULT *****
os: Stacking error (context area might be not valid)
os: Data Access Violation
os: MMFAR Address: 0x2000aa38
os: r0/a1: 0x00000000 r1/a2: 0x00000000 r2/a3: 0x00000000
os: r3/a4: 0x00000000 r12/ip: 0x00000000 r14/lr: 0x00000000
os: xpsr: 0x00000000
os: Faulting instruction address (r15/pc): 0x00000000
os: >>> ZEPHYR FATAL ERROR 2: Stack overflow on CPU 0
os: Current thread: 0x20002d28 (BT RX)
os: Halting system

Default stack size if not enought and was causing MPU faults.
This was affecting GATT/SR/GAW/BV-14-C qualification test case.

<dbg> bttester_gatt: gatt_db_add: handle 0x0000
<err> os: ***** MPU FAULT *****
<err> os:   Stacking error (context area might be not valid)
<err> os:   Data Access Violation
<err> os:   MMFAR Address: 0x2000aa38
<err> os: r0/a1:  0x00000000  r1/a2:  0x00000000  r2/a3:  0x00000000
<err> os: r3/a4:  0x00000000 r12/ip:  0x00000000 r14/lr:  0x00000000
<err> os:  xpsr:  0x00000000
<err> os: Faulting instruction address (r15/pc): 0x00000000
<err> os: >>> ZEPHYR FATAL ERROR 2: Stack overflow on CPU 0
<err> os: Current thread: 0x20002d28 (BT RX)
<err> os: Halting system

Signed-off-by: Szymon Janc <[email protected]>
@sjanc
Copy link
Contributor Author

sjanc commented Oct 9, 2023

Interestingly first bad commit that caused this was #63605 and indeed reverting it "fix" the issue. Looks like stack was almost fully used anyway and I wouldn't be surprised if we would hit this without revert but with eg. different optimization level in compiler.

@jhedberg jhedberg added area: Tests Issues related to a particular existing or missing test area: Bluetooth Qualification Bluetooth Qualification -related issues and pull requests labels Oct 9, 2023
@jhedberg jhedberg added this to the v3.5.0 milestone Oct 9, 2023
@carlescufi carlescufi merged commit 4c269d0 into zephyrproject-rtos:main Oct 10, 2023
@sjanc sjanc deleted the tester_bt_rx_stack branch October 10, 2023 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Bluetooth Qualification Bluetooth Qualification -related issues and pull requests area: Bluetooth area: Tests Issues related to a particular existing or missing test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants