Skip to content

K64F ethernet driver enables interrupts before the interrupt handlers are set #3358

Closed
@kuggenhoffen

Description

@kuggenhoffen

Description

  • Type: Bug
  • Priority: Minor

Bug

Target
K64F

Toolchain:
IAR

Toolchain version:
7.80

mbed-cli version:
1.0.0

meed-os sha:
a1c0840 (HEAD, tag: mbed_lib_rev129, tag: mbed-os-5.2.2) Merge pull request #3227 from ARMmbed/release-candidate

DAPLink version:
0242

Expected behavior
Ethernet driver IRQ handlers (ENET_Transmit_IRQHandler, ENET_Receive_IRQHandler or ENET_Error_IRQHandler) should not get called when s_ENETHandle[0] is null.

Actual behavior
It seems that there is a small time window in ENET_Init where interrupts are enabled but the instance handle has not been added to s_ENETHandle resulting in null pointer usage in the interrupt handles in case an interrupt happens within this time window.

Steps to reproduce

  1. Debug mbed-os-example-sockets using IAR
  2. Run -> observe that example works correctly
  3. Reset (Software reset by default)
  4. Run -> observe that hardfault happens

In step 3. if one does hardware reset instead of software, the example works correctly.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions