On 05/29/2017 10:58 PM, Gene Heskett wrote:
>> I'll build a clean SD card with all on it once I get it all debugged,
>> and hopefully fixed.
> 
> One comment, this one is failing with the newest kernel, 4.9.30-rt20-v7+.

I think it is because lcnc was compiled with another kernel in mind. I
compiled mine with (in src dir):
        $ ./configure --with-realtime=uspace
--with-kernel-headers=/home/bertho/marvin/kernel-rt-preempt/linux-rpi-4.9.y/include
--enable-non-distributable

And above was with the 4.9.30-rt20-v7+ kernel source-tree.

Your system may have a problem with the API of the newer kernel version.

[snip]

I may have a fix to the SPI problem. There seems to be a problem in
clock-setting, which me apparently have been seeing. The attached patch
is very simple and works correct and so all the time.

The second change in that patch is a temporary stack-buffer allocation
that the compiler is complaining about (too large). This should be fixed
more permanently. However, the current change is sufficient for now and
works with some headroom left:
        $ cat /proc/cpuinfo |wc -c
        1136


-- 
Greetings Bertho

(disclaimers are disclaimed)
diff --git a/src/hal/drivers/mesa-hostmot2/hm2_rpspi.c b/src/hal/drivers/mesa-hostmot2/hm2_rpspi.c
index a6a8b5c..72b14f2 100644
--- a/src/hal/drivers/mesa-hostmot2/hm2_rpspi.c
+++ b/src/hal/drivers/mesa-hostmot2/hm2_rpspi.c
@@ -473,6 +473,7 @@ static void setup_gpio(uint16_t spiclkdiv) {
 	BCM2835_GPFSEL1 = x;
 
 	/* set up SPI */
+	BCM2835_SPICLK = 0;	// Do it twice with different values, otherwise it will not be set properly
 	BCM2835_SPICLK = (1 << spiclkdiv);
 
 	BCM2835_SPICS = 0;
@@ -505,7 +506,7 @@ static void restore_gpio() {
 static platform_t check_platform(void)
 {
 	FILE *fp;
-	char buf[8192];
+	char buf[2048];	// FIXME: This is bad, large buffer on the stack and may never be enough
 	size_t fsize;
 
 	fp = fopen("/proc/cpuinfo", "r");
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to