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

The button interrupt enters the spurious handler #24291

Closed
jasonedn opened this issue Apr 11, 2020 · 6 comments
Closed

The button interrupt enters the spurious handler #24291

jasonedn opened this issue Apr 11, 2020 · 6 comments
Assignees
Labels
area: GPIO bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug

Comments

@jasonedn
Copy link

jasonedn commented Apr 11, 2020

Describe the bug
The button sample ran on the board nucleo_l476rg, When the button was pressed, it entered the spurious handler instead of the button handler.

To Reproduce
Build the button sample on the board nucleo_l476rg with the command:
west build -p auto -b nucleo_l476rg samples/basic/button

Expected behavior
When the blue button is pressed, it entered the spurious handler and stuck there.

Impact

Screenshots or console output
With the debugger, the address of _sw_isr_tables is 0x08003424 and the offset of GPIO exti_15_10 is 40*8=0x140, so the exti_15_10 address in the table is 0x08003564. From the data below, the ISR address of exti_15_10 is 0x08002BCF that points to the spurious handler instead of the button handler.
sw_isr_tables_data

However according to the generated isr_tables.c, _sw_isr_table is initialized correctly (offset=40) as below.

struct _isr_table_entry __sw_isr_table _sw_isr_table[82] = {
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x2000104c, (void *)0x8002b2b},
{(void *)0x2000104c, (void *)0x8002b35},
{(void *)0x2000104c, (void *)0x8002b3f},
{(void *)0x2000104c, (void *)0x8002b49},
{(void *)0x2000104c, (void *)0x8002b53},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x2000104c, (void *)0x8002b5d},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x2000104c, (void *)0x8002b67},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
{(void *)0x0, (void *)&z_irq_spurious},
};

Environment (please complete the following information):
Toolchain - Zephyr SDK

Additional context

When the codes are downloaded, I set the content @0x8003564 in _sw_isr_tables to (0x2000104c, 0x08002B67) from the source codes, it entered the desired button handler.

Why are the source codes correct but the built binary is not?

@jasonedn
Copy link
Author

This issue occurred in Windows but it worked in Linux platform.

@carlescufi carlescufi added area: GPIO platform: STM32 ST Micro STM32 priority: low Low impact/importance bug labels Apr 14, 2020
@erwango
Copy link
Member

erwango commented Apr 15, 2020

^^@ABOSTM, can you have a check on your side ?

@ABOSTM
Copy link
Collaborator

ABOSTM commented Apr 15, 2020

Hi @jasonedn,
I tested on my side, and I face no issue:
Host: Windows
Zephir SHA1: ab15602
Board: nucleo_l476rg
Log console:

Button pressed at 790090416
Button pressed at 1221538460
Button pressed at 1221649043

Can you tell us more about your environment: host ? toolchain? ...
Can you also try on the same SHA1 than mine ?

@jasonedn
Copy link
Author

jasonedn commented Apr 15, 2020 via email

@erwango
Copy link
Member

erwango commented Apr 17, 2020

@andrewboie, we're not able to reproduce the issue, maybe your knowledge of this part will be more efficient to solve this point?

@erwango erwango removed the platform: STM32 ST Micro STM32 label Apr 17, 2020
@jasonedn
Copy link
Author

After I uninstalled Visual Studio Community IDE and zephyr software from my computer, and then I re-installed zephyr software, it worked properly. It seems that it was caused by some improper settings of the VS software.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: GPIO bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug
Projects
None yet
Development

No branches or pull requests

5 participants