Skip to content

Program Freezes When Using [MICROPY_BEGIN_ATOMIC_SECTION(); ]Function #165

@scarletwiz

Description

@scarletwiz

I am currently working on integrating the network functionality into an existing MicroPython module, specifically for WIZNET5K.

I've successfully implemented most features by porating SPI and the micropython-microbit-v2\lib\micropython\extmod\network_wiznet5k.c file.
However, I encounter a problem where the process freezes at the point in the code where MICROPY_BEGIN_ATOMIC_SECTION(); is called.

Here's the relevant code snippet (micropython-microbit-v2\lib\micropython\extmod\network_wiznet5k.c/ Line 130):

STATIC void wiz_cris_enter(void) {
    wiznet5k_obj.cris_state = MICROPY_BEGIN_ATOMIC_SECTION();
}

If I omit this section, the process runs, but the mutex functionality, which is crucial for this program, is lost.

This feature operates flawlessly on other MCUs, such as the rp2040 and stm32. What might be causing the difference with the microbit? Or is there another aspect of the modification that I might have overlooked?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions