RockySong / micropython-rocky

micropython and OpenMV port to NXP MCUs
MIT License
190 stars 77 forks source link

cant't make project #2

Closed AlexYzhov closed 1 year ago

AlexYzhov commented 6 years ago

CC main.c

main.c: In function '__fatal_error':

main.c:103:1: error: 'noreturn' function does return [-Werror]

}

^

cc1: all warnings being treated as errors

../../py/mkrules.mk:47: recipe for target 'build-imxrtevk105x/main.o' failed

make: *** [build-imxrtevk105x/main.o] Error 1`

make reports that there's a noreturn function does return in main.c:

`void NORETURN __fatal_error(const char *msg) {

for (volatile uint delay = 0; delay < 10000000; delay++) {}

led_state(1, 1);

led_state(2, 1);

led_state(3, 1);

led_state(4, 1);

mp_hal_stdout_tx_strn("\nFATAL ERROR:\n", 14);

mp_hal_stdout_tx_strn(msg, strlen(msg));

for (uint i = 0;i<1000;i++) {

    // led_toggle(((i++) & 3) + 1);

    led_toggle(0);

    for (volatile uint delay = 0; delay < 10000000; delay++) {

    }

    if (i >= 16) {

        // to conserve power

        __WFI();

    }

}

}`

ianhom commented 6 years ago

use gcc? Keil project has no problem with compiling.

AlexYzhov commented 6 years ago

got it, it works fine under Keil environment. But I'm still confused why gcc didn't work, there must be something wrong. Hope somebody check it soon

RockySong commented 6 years ago

Sorry for the inconvenience, you may add while(1) {} at the end of the __fatal_error(). GCC Makefile and related porting is not yet completed.

sdew commented 6 years ago

Modified some files, can now be compiled with gcc. But the board is not around, not tested yet