Skip to content

Serial broken with Nucleo F303K8 on GCC-ARM #1631

@ducky64

Description

@ducky64

Deploying code exported to GCC-ARM from the mbed online compiler using Serial causes the microcontroller to freeze and end up in WWDG_IRQHandler().

If compiled against the mbed library (at tag mbed_lib_rev116) from scratch (as opposed to the pre-compiled .a supplied from the online compiler export), stepping through has it failing in
_file = std::fopen(buf, "w+"); (mbed/common/Stream.cpp:24)

The instruction call stack looks like (inside the std::fopen call):
Serial uart(SERIAL_TX, SERIAL_RX);
mbed::Stream::Stream()
_fopen_r()
__sfp()
__sinit()
std.isra.0
where the last instruction executed is:
08005376: str r3, [r0, #0]
(where register r0 = 0, presumably what causes the hardfault)

Note that manually invoking the serial API functions seems to work:

serial_t obj;
serial_init(&obj, SERIAL_TX, SERIAL_RX);
serial_putc(&obj, 'x');

so the root cause of the problem doesn't appear to be the serial HAL, but rather the interaction of the system libraries with ... something ...

I'm using gcc version 5.2.1 20151202 (release) [ARM/embedded-5-branch revision 231848] (GNU Tools for ARM Embedded Processors).

Possibly related to this issue:
https://developer.mbed.org/forum/bugs-suggestions/topic/25983
which is 24 days old without a resolution.

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