I had used the periplex-sync -p .json command on the following json file :-
{
"uart": [
{
"id": 0,
"TX": "GPIOT_RXP28",
"RX": "GPIOT_RXN28"
}
],
"i2c": [],
"gpio": [
{
"id": 1,
"GPIO-0": "GPIOR_168",
"GPIO-1": "GPIOL_17",
"GPIO-2": "GPIOL_20",
"GPIO-3": "GPIOL_18",
"GPIO-4": "GPIOR_187",
"GPIO-5": "GPIOL_24",
"GPIO-6": "GPIOL_66",
"GPIO-7": "GPIOL_62"
}
],
"pwm": [],
"ws": [],
"spi":[],
"onewire": [],
"can": [],
"i2s": []
}
The operation was successful and I then proceeded to reboot the device.
But after reboot, when I ran the ls /dev command, it didn’t show any activated pins for UART or GPIO.
What could have possibly gone wrong. Please help!
vatsal
February 21, 2025, 10:21am
2
you can see ttyPERI0
and gpiochip6
are created using the periplex, this type of information will provide coming soon in the docs of periplex.
Ok, so are you saying that peripherals get created and not highlighted once we configure the .json file? And the gpiochip6 and ttyPERI0 peripherals were not initialized beforehand?
I am using the following code to transmit data from Vaaman to a Serial Monitor on my PC using an TTL to USB converter (FTDI Module) :-
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <termios.h>
#include <string.h>
int main() {
int uart_fd;
struct termios options;
// Open the UART device (ttyS0)
uart_fd = open("/dev/ttyPERI0", O_RDWR | O_NOCTTY | O_NDELAY);
if (uart_fd == -1) {
perror("Error opening UART");
return -1;
}
// Configure UART settings
tcgetattr(uart_fd, &options);
cfsetispeed(&options, B115200); // Set baud rate to 115200
cfsetospeed(&options, B115200);
options.c_cflag |= (CLOCAL | CREAD);
options.c_cflag &= ~PARENB; // No parity
options.c_cflag &= ~CSTOPB; // 1 stop bit
options.c_cflag &= ~CSIZE;
options.c_cflag |= CS8; // 8 data bits
tcsetattr(uart_fd, TCSANOW, &options);
while(1){
// Send "hello world"
char message[] = "hello world\n";
int bytes_written = write(uart_fd, message, strlen(message));
if (bytes_written < 0) {
perror("Failed to write to UART");
} else {
printf("Sent: %s", message);
}
}
// Close the UART device
close(uart_fd);
return 0;
}
The code runs successfully as depicted in the screenshot :-
But, am unable to receive data on the other end, What could be the issue here…
vatsal
February 21, 2025, 12:05pm
5
Use the following command to store kernel logs in a file(dmesg.txt here).
sudo dmesg > dmesg.txt
Upload the same over here.