Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4906

General • Re: output(printf()) does not show in the serial monitor

$
0
0
After adding this below code in multicore.c file.


/******************************************************
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/

#include <stdio.h>
#include "pico/stdlib.h"
#include "pico/multicore.h"

#define FLAG_VALUE 123

void core1_entry() {

sleep_ms(500);

multicore_fifo_push_blocking(FLAG_VALUE);

uint32_t g = multicore_fifo_pop_blocking();

if (g != FLAG_VALUE)
printf("Hmm, that's not right on core 1!\n");
else
printf("It's all gone well on core 1!\n");

while (1)
tight_loop_contents();
}

int main() {
// stdio_init_all();

stdio_usb_init();
while (!stdio_usb_connected()) {}

sleep_ms(1000);

printf("Hello, multicore!\n");

/// \tag::setup_multicore[]

multicore_launch_core1(core1_entry);

// Wait for it to start up

uint32_t g = multicore_fifo_pop_blocking();

if (g != FLAG_VALUE)
printf("Hmm, that's not right on core 0!\n");
else {
multicore_fifo_push_blocking(FLAG_VALUE);
printf("It's all gone well on core 0!\n");
}
/// \end::setup_multicore[]
while(1){}
}
******************************************************************/
After compile it, showing errrors like:1).[{
"resource": "/c:/D_DRIVE/vineetha/Rasberry_PI/Software/hello_multicore/multicore.c",
"owner": "cpptools",
"severity": 4,
"message": "implicit declaration of function 'stdio_usb_init'; did you mean 'stdio_uart_init'? [-Wimplicit-function-declaration]",
"source": "gcc",
"startLineNumber": 33,
"startColumn": 5,
"endLineNumber": 33,
"endColumn": 5
}]
2).[{
"resource": "/c:/D_DRIVE/vineetha/Rasberry_PI/Software/hello_multicore/multicore.c",
"owner": "cpptools",
"severity": 4,
"message": "implicit declaration of function 'stdio_usb_connected' [-Wimplicit-function-declaration]",
"source": "gcc",
"startLineNumber": 34,
"startColumn": 13,
"endLineNumber": 34,
"endColumn": 13
}]



How to solve this errors?.

Statistics: Posted by Vineethad — Mon Oct 28, 2024 5:27 am



Viewing all articles
Browse latest Browse all 4906

Trending Articles