Loading...
 

STM32MP1 support available in SW4STM32

   With System Workbench for Linux, Embedded Linux on the STM32MP1 family of MPUs from ST was never as simple to build and maintain, even for newcomers in the Linux world.
And, if you install System Workbench for Linux in System Workbench for STM32 you can seamlessly develop and debug asymmetric applications running partly on Linux, partly on the Cortex-M4; you can download a short video showcasing this on the ac6-tools website (registration required).

System Workbench for STM32


You are viewing a reply to undefined reference to `_times'  

undefined reference to `_times'

France

Hi,

Obviously, it’s not in this routine that you reference times; however, as you provide assembly code, the fact you call this function will link in your program all other code from the same source file, so I suspect the problem may come from other pieces of code in the same file (even if they are not called...)

Note that the times’ C library routine is useless on an MCU (it summarize execution time for a linux process and its children) and needs a support function called _times’’ to gather these, function that does not exist as it has no use. You could just provide it in syscalls.c by adding:

#include "sys/times.h"
clock_t _times(struct tms* tms) {
    errno = EINVAL;
    return (clock_t)-1;
}

However this will just allow your code to link, but either it will not work as expected (if times if effectively called) or will contain dead code (due to your assembly-level code).

Just a question: why did you code in assembly language, instead of C? Your function could as well have been written in C; moreover you seem to pass only one single parameter in the R3 register, which is quite unusual (parameters must be passed in R0, R1, R2 and R3, that do not have to be saved as they are scratch registers). As is, your function could only be called from assembly-level code, not from C code.

Bernard (Ac6)