Alpine Linux run/compile problem

Applications, development tools, FPGA, C, WEB
kasaudio
Posts: 33
Joined: Sun Mar 11, 2018 6:03 pm

Re: Alpine Linux run/compile problem

Post by kasaudio » Sat Mar 21, 2020 1:01 am

Regarding i2c I have one question... where or how to set iic speed 100/400/hi-speed for RP?

pavel
Posts: 567
Joined: Sat May 23, 2015 5:22 pm

Re: Alpine Linux run/compile problem

Post by pavel » Sat Mar 21, 2020 11:33 am

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.

kasaudio
Posts: 33
Joined: Sun Mar 11, 2018 6:03 pm

Re: Alpine Linux run/compile problem

Post by kasaudio » Sat Mar 21, 2020 8:28 pm

Thank you. 400kHz is OK.

kasaudio
Posts: 33
Joined: Sun Mar 11, 2018 6:03 pm

Re: Alpine Linux run/compile problem

Post by kasaudio » Wed Apr 01, 2020 3:52 pm

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!

pavel
Posts: 567
Joined: Sat May 23, 2015 5:22 pm

Re: Alpine Linux run/compile problem

Post by pavel » Wed Apr 01, 2020 4:56 pm

Here is a link to the code that works for me:
https://github.com/pavel-demin/DiscoRed ... #L110-L122

kasaudio
Posts: 33
Joined: Sun Mar 11, 2018 6:03 pm

Re: Alpine Linux run/compile problem

Post by kasaudio » Wed Apr 01, 2020 5:29 pm

Thank you. In the meantime I managed to solve myself also. Will take a look at your solution. THX!

Post Reply
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie

Who is online

Users browsing this forum: No registered users and 26 guests