Page 2 of 2

Re: Alpine Linux run/compile problem

Posted: Sat Mar 21, 2020 1:01 am
by kasaudio
Regarding i2c I have one question... where or how to set iic speed 100/400/hi-speed for RP?

Re: Alpine Linux run/compile problem

Posted: Sat Mar 21, 2020 11:33 am
by pavel
I think the default I2C speed is set to 400000 in devicetree.dtb. So, it should be possible to change the I2C speed by modifying devicetree.dtb and restarting the operating system.

Re: Alpine Linux run/compile problem

Posted: Sat Mar 21, 2020 8:28 pm
by kasaudio
Thank you. 400kHz is OK.

Re: Alpine Linux run/compile problem

Posted: Wed Apr 01, 2020 3:52 pm
by kasaudio
While I managed to almost finish my project I got stuck with uart...

I am able to communicate, but in some case I need binary communication instead of ascii strings. I cannot set the input mode correctly according to uart example and

https://pubs.opengroup.org/onlinepubs/0 ... ios.h.html

Code: Select all

	cfsetspeed(&settings, baud_rate);

	settings.c_cflag &= ~PARENB; /* no parity */
	settings.c_cflag &= ~CSTOPB; /* 1 stop bit */
	settings.c_cflag &= ~CSIZE;
	settings.c_cflag |= CS8 | CLOCAL; /* 8 bits */
	//settings.c_lflag = ICANON; /* canonical mode */
	settings.c_oflag &= ~OPOST; /* raw output */
	
	settings.c_iflag &= ~ICRNL;
	settings.c_iflag &= ~INLCR;
	settings.c_iflag &= ~IGNCR;

	/* Setting attributes */
	tcflush(uart_fd, TCIFLUSH);
	tcsetattr(uart_fd, TCSANOW, &settings);
If I send some string without crlf to RP, nothing is signalled to be read. As I add crlf I get all preivous data as well. I would like my RP receives everything sent instantly.

thx for help!

Re: Alpine Linux run/compile problem

Posted: Wed Apr 01, 2020 4:56 pm
by pavel
Here is a link to the code that works for me:
https://github.com/pavel-demin/DiscoRed ... #L110-L122

Re: Alpine Linux run/compile problem

Posted: Wed Apr 01, 2020 5:29 pm
by kasaudio
Thank you. In the meantime I managed to solve myself also. Will take a look at your solution. THX!