Bonjour à tous,
Je pense avoir tout fait ce qui est demandé dans le TP.
Mais, après exécution du Make qui n’affiche pas d’erreur, rien ne s’affiche. Un message devrait s’afficher tous les 0,5s et je n’ai pas le prompt du shell.
contenu de main.c :
#include <stdio.h>
#include “shell.h”
#include “thread.h”
#include “xtimer.h”
static char stack[THREAD_STACKSIZE_MAIN];
/* Include threads header and declare the thread stack */
/* Implement thread handler function here */
static void *thread_handler(void *arg)
{
(void)arg;
puts(“Hello from thread!”);
while (1) {}
return NULL;
}
int main(void)
{
/* Start new threads here /
thread_create(stack, sizeof(stack), THREAD_PRIORITY_MAIN + 1,
0, thread_handler, NULL, “new thread”);
/ Start the shell here */
/*char line_buf[SHELL_DEFAULT_BUFSIZE];
shell_run(NULL, line_buf, SHELL_DEFAULT_BUFSIZE);
*/
int counter = 0;
while (1) {
counter++;
printf(“Message %d from main thread\n”, counter);
/* add 500ms delay */
xtimer_usleep(500 * US_PER_MS);
}
return 0;
Contenu de makefile:
APPLICATION ?= threading
BOARD ?= native
Add extra modules here
USEMODULE += shell
USEMODULE += shell_commands
USEMODULE += ps
USEMODULE += xtimer
Add extended thread information
DEVELHELP ?= 1
RIOTBASE ?= $(CURDIR)/…/…/RIOT
include $(RIOTBASE)/Makefile.include
}
Et voici l’affichage dans le terminal :
jovyan@840bdaed91ff:~/work/iot-lab-training$ make -C riot/basics/timers all term
make: Entering directory ‘/home/jovyan/work/iot-lab-training/riot/basics/timers’
Building application “timers” for “native” with MCU “native”.
“make” -C /home/jovyan/work/iot-lab-training/riot/RIOT/boards/native
“make” -C /home/jovyan/work/iot-lab-training/riot/RIOT/boards/native/drivers
“make” -C /home/jovyan/work/iot-lab-training/riot/RIOT/core
“make” -C /home/jovyan/work/iot-lab-training/riot/RIOT/cpu/native
“make” -C /home/jovyan/work/iot-lab-training/riot/RIOT/cpu/native/periph
“make” -C /home/jovyan/work/iot-lab-training/riot/RIOT/cpu/native/stdio_native
“make” -C /home/jovyan/work/iot-lab-training/riot/RIOT/cpu/native/vfs
“make” -C /home/jovyan/work/iot-lab-training/riot/RIOT/drivers
“make” -C /home/jovyan/work/iot-lab-training/riot/RIOT/drivers/periph_common
“make” -C /home/jovyan/work/iot-lab-training/riot/RIOT/sys
“make” -C /home/jovyan/work/iot-lab-training/riot/RIOT/sys/auto_init
text data bss dec hex filename
21255 576 47664 69495 10f77 /home/jovyan/work/iot-lab-training/riot/basics/timers/bin/native/timers.elf
/home/jovyan/work/iot-lab-training/riot/basics/timers/bin/native/timers.elf
RIOT native interrupts/signals initialized.
LED_RED_OFF
LED_GREEN_ON
RIOT native board initialized.
RIOT native hardware initialization complete.
main(): This is RIOT! (Version: 2020.01)