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

General • Re: PT52-Lua The Modern Retro computer

$
0
0
It seems gcc 13.2.1 does not compile your code right.
It might be those warning you got, It's doing something different that the compilers I've tried.

From board.h
FYI, I tried to add this to CMakeLists.txt:

Code:

pico_enable_stdio_uart(${BINARY} 1)target_compile_definitions(${BINARY} PUBLIC  PICO_DEFAULT_UART_TX_PIN=20  PICO_DEFAULT_UART_RX_PIN=21)# Serial GPIO means SD card is 1 bit (4 bits otherwise)set(PICO_SD_DAT_PIN_COUNT 1)
And this to simple_start.c:

Code:

    sleep_ms(250);    stdio_init_all();    sleep_ms(250);    printf("*** PT52! ***\n");
These statements work in my projects.
The PICO_DEFAULT_UART_ are already defined in board.h so you don't need them
set(PICO_SD_DAT_PIN_COUNT 1) has no effect the SD driver I use only works in SPI mode

To get output from UART you need to do something like

On the SD card create a file named autoexec and set the system flag

Code:

uses("uart")uart.init(9600)uart.send("*** PT52! ***\n")uart.close()
The reason your C code won't work might be that stdio isn't configured to use the UART and printf is overridden

Code:

// OVERRIDE STDOUT FUNCTIONS WITH INTERNAL VERSIONS#undef printf#define printf Printf#undef putchar#define putchar Decode_Character#undef puts#define puts Puts

Statistics: Posted by DarkElvenAngel — Sat Dec 07, 2024 2:29 pm



Viewing all articles
Browse latest Browse all 4906

Trending Articles