Jump to content


Photo

LinuxCNC


  • Please log in to reply
14 replies to this topic

#1 cutedigi

cutedigi

    Advanced Member

  • Members
  • PipPipPip
  • 100 posts

Posted 12 February 2015 - 04:41 AM

Sweet a CNC section!!

It seems there is a list of items to contend with regarding making LinuxCNC work on the pcDuino. I am by  NO means a programmer or kernel hacker so please bear with me. cheesy.gif

1. Get a realtime kernel to run on the pcDuino.
     a. Which one to use? RT patch or www.xenomai.org etc...
2. Get the HAL and Parport working to output to GPIO pins.
     a. Who knows where to start here. I hope someone does tongue.gif
3. Get the Mali stuff to work. 
     a. The Axis interface needs GL related support. The simulation window is also GL.
     b. Off the top of my head, GTK+ is one of the components that needs to work.

There's lots more. I think there are 2 paths to take to start. 
Number 1, or 3 including getting the simulator mode to compile.

I think before 3, we need some source files or a Mali working image. Possibly the XMBC image, since Mali is working. The wifi driver is broken though.

Anyone care to comment? 

meistro



#2 cutedigi

cutedigi

    Advanced Member

  • Members
  • PipPipPip
  • 100 posts

Posted 12 February 2015 - 04:42 AM

I'm with you on this. 

Quote
2. Get the HAL and Parport working to output to GPIO pins.     a. Who knows where to start here. I hope someone does 
 

It's been awhile since I tinkered with linuxCnc but I'm setting up a dev machine so in a couple of days I hope to have a working HAL hardware driver for gpio. 



#3 cutedigi

cutedigi

    Advanced Member

  • Members
  • PipPipPip
  • 100 posts

Posted 12 February 2015 - 04:42 AM

There seems to be a similar project going on over here...

https://www.olimex.c...php?topic=812.0

They seem to have a working Xenomai on the A10/13

Now that I finally have a good working system on a 32gb class 10 card I'm gonna dig in deep tomorrow. grin.gif



#4 cutedigi

cutedigi

    Advanced Member

  • Members
  • PipPipPip
  • 100 posts

Posted 12 February 2015 - 04:42 AM

i found a patch but i must be doing something wrong because i get errors when applying it to 3.4.29 kernel, the patch says 3.4.29-r1 but i cant find any r1 branch.

I will continue this tomorrow.



#5 cutedigi

cutedigi

    Advanced Member

  • Members
  • PipPipPip
  • 100 posts

Posted 12 February 2015 - 04:42 AM

Try this one...

https://github.com/l....4.29-r1.tar.gz

Have fun, please post your results. They really have a lot of info in that Olimex forum concerning mainly the A13. But I seen mention that it should work also with A10 but it's un-tested. 

I have a few hours to try it out. I'll be happy if I can get Xenomai to boot tonight.



#6 cutedigi

cutedigi

    Advanced Member

  • Members
  • PipPipPip
  • 100 posts

Posted 12 February 2015 - 04:42 AM

i did. everything compiles fine but the pcDuino does not start. i didnt have any 3.3v ftdi for serial so i'll have to solder one tonight to see what happens



#7 cutedigi

cutedigi

    Advanced Member

  • Members
  • PipPipPip
  • 100 posts

Posted 12 February 2015 - 04:43 AM

Here's how far I got...

Welcome to minicom 2.6.1

OPTIONS: I18n 
Compiled on May  1 2012, 13:36:18.
Port /dev/ttyUSB0

Press CTRL-A Z for help on special keys


U-Boot SPL 2012.10-04277-g7aa9f04-dirty (Mar 05 2013 - 10:52:38)
DRAM: 1024MB
SUNXI SD/MMC: 0


U-Boot 2012.10-04277-g7aa9f04-dirty (Mar 05 2013 - 10:52:38) Allwinner Technology 

CPU:   SUNXI Family
Board: A10
I2C:   ready
DRAM:  1 GiB
MMC:   SUNXI SD/MMC: 0
In:    serial
Out:   serial
Err:   serial
Hit any key to stop autoboot:  0 
reading uEnv.txt

** Unable to read "uEnv.txt" from mmc 0:1 **
Loading file "uEnv.txt" from mmc device 0:1
Failed to mount ext2 filesystem...
** Bad ext2 partition or disk - mmc 0:1 **
ext2load - load binary file from a Ext2 filesystem

Usage:
ext2load <interface> <dev[:part]> [addr] [filename] [bytes]
    - load binary file 'filename' from 'dev' on 'interface'
      to address 'addr' from ext2 filesystem
Loading file "boot/uEnv.txt" from mmc device 0:1
Failed to mount ext2 filesystem...
** Bad ext2 partition or disk - mmc 0:1 **
ext2load - load binary file from a Ext2 filesystem

Usage:
ext2load <interface> <dev[:part]> [addr] [filename] [bytes]
    - load binary file 'filename' from 'dev' on 'interface'
      to address 'addr' from ext2 filesystem
reading boot.scr

** Unable to read "boot.scr" from mmc 0:1 **
Loading file "boot.scr" from mmc device 0:1
Failed to mount ext2 filesystem...
** Bad ext2 partition or disk - mmc 0:1 **
ext2load - load binary file from a Ext2 filesystem

Usage:
ext2load <interface> <dev[:part]> [addr] [filename] [bytes]
    - load binary file 'filename' from 'dev' on 'interface'
      to address 'addr' from ext2 filesystem
Loading file "boot/boot.scr" from mmc device 0:1
Failed to mount ext2 filesystem...
** Bad ext2 partition or disk - mmc 0:1 **
ext2load - load binary file from a Ext2 filesystem

Usage:
ext2load <interface> <dev[:part]> [addr] [filename] [bytes]
    - load binary file 'filename' from 'dev' on 'interface'
      to address 'addr' from ext2 filesystem
reading script.bin

44900 bytes read
reading uImage

4358784 bytes read
## Booting kernel from Legacy Image at 48000000 ...
   Image Name:   Linux-3.4.29-ipipe
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    4358720 Bytes = 4.2 MiB
   Load Address: 40008000
   Entry Point:  40008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

<6>Booting Linux on physical CPU 0
<6>Initializing cgroup subsys cpuset
<5>Linux version 3.4.29-ipipe (mark@mark) (gcc version 4.7.2 (Ubuntu/Linaro 4.7.2-1ubuntu1) ) #3
CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine: sun4i
<6>Memory cut off:
<6>     MALI : 0x5c000000 - 0x5fffffff  (  64 MB)
<4>Ignoring unrecognised tag 0x00000000
<6>Memory Reserved:
<6>     SYS  : 0x43000000 - 0x4300ffff  (  64 kB)
<6>     VE   : 0x44000000 - 0x48ffffff  (  80 MB)
<6>     G2D  : 0x49000000 - 0x49ffffff  (  16 MB)
<6>     LCD  : 0x5a000000 - 0x5bffffff  (  32 MB)
Memory policy: ECC disabled, Data cache writeback
<6>chip-id: A10 (AW1623 revision C)
<7>On node 0 totalpages: 245760
<7>free_area_init_node: node 0, pgdat c081bda8, node_mem_map c0a74000
<7>  Normal zone: 1520 pages used for memmap
<7>  Normal zone: 0 pages reserved
<7>  Normal zone: 176656 pages, LIFO batch:31
<7>  HighMem zone: 528 pages used for memmap
<7>  HighMem zone: 67056 pages, LIFO batch:15
<7>pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768<c>
<7>pcpu-alloc: <c>[0] <c>0 <c>
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 243712
<5>Kernel command line: console=ttyS0,115200 console=tty0 root=/dev/mmcblk0p2 rootwait loglevel0
<6>PID hash table entries: 4096 (order: 2, 16384 bytes)
<6>Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
<6>Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
<6>Memory: 448MB 512MB = 960MB total
<5>Memory: 832672k/832672k available, 150368k reserved, 270336K highmem
<5>Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    vmalloc : 0xf0000000 - 0xff000000   ( 240 MB)
    lowmem  : 0xc0000000 - 0xef800000   ( 760 MB)
    pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
    modules : 0xbf000000 - 0xbfe00000   (  14 MB)
      .text : 0xc0008000 - 0xc079ede0   (7772 kB)
      .init : 0xc079f000 - 0xc07cb000   ( 176 kB)
      .data : 0xc07cc000 - 0xc0823330   ( 349 kB)
       .bss : 0xc0823354 - 0xc0a73588   (2369 kB)
<6>SLUB: Genslabs=11, HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
<6>NR_IRQS:128
<6>timer2: Periodic Mode
<6>I-pipe, 200.000 MHz clocksource
<6>sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 4294967286ms
<6>Interrupt pipeline (release #4)
<6>Console: colour dummy device 80x30
<6>console [tty0] enabled
<6>Calibrating delay loop... <c>380.92 BogoMIPS (lpj=1904640)
<6>pid_max: default: 32768 minimum: 301
<6>Mount-cache hash table entries: 512
<6>Initializing cgroup subsys cpuacct
<6>Initializing cgroup subsys devices
<6>Initializing cgroup subsys freezer
<6>Initializing cgroup subsys blkio
<6>CPU: Testing write buffer coherency: ok
<6>hw perfevents: enabled with ARMv7 Cortex-A8 PMU driver, 5 counters available
<6>Setting up static identity map for 0x40544f38 - 0x40544f90
<6>devtmpfs: initialized
<6>dummy: 
<6>NET: Registered protocol family 16
<6>hw-breakpoint: debug architecture 0x4 unsupported.
SOFTWINNER DMA Driver, (c) 2003-2004,2006 Simtec Electronics
<6>Initialize DMAC OK
<6>Init eGon pin module V2.0
<6>bio: create slab <bio-0> at 0
<5>SCSI subsystem initialized
<7>libata version 3.00 loaded.
<6>usbcore: registered new interface driver usbfs
<6>usbcore: registered new interface driver hub
<6>usbcore: registered new device driver usb
<6>Linux video capture interface: v2.00
<6>Advanced Linux Sound Architecture Driver Version 1.0.25.
<6>Switching to clocksource ipipe_tsc
<5>FS-Cache: Loaded

That was the serial output from just replacing the uImage on my mmc. I figured it probably wouldn't work but its late and the day is over smiley.gif



#8 cutedigi

cutedigi

    Advanced Member

  • Members
  • PipPipPip
  • 100 posts

Posted 12 February 2015 - 04:43 AM

If I can pull the .config from the latest build maybe I'll have better results



#9 cutedigi

cutedigi

    Advanced Member

  • Members
  • PipPipPip
  • 100 posts

Posted 12 February 2015 - 04:43 AM

TGIW! I didnt get much time this week, but now im free for the weekend so i'll get 
on with some soldering and troubleshooting



#10 cutedigi

cutedigi

    Advanced Member

  • Members
  • PipPipPip
  • 100 posts

Posted 12 February 2015 - 04:43 AM

How are you progressing with RT patch?

By the way, for 1), there is a comparison paper here: https://www.osadl.or...ws/12/Brown.pdf

It seems like Xenomai performs better in terms of real time processing.



#11 cutedigi

cutedigi

    Advanced Member

  • Members
  • PipPipPip
  • 100 posts

Posted 12 February 2015 - 04:44 AM

has anyone made this work already?



#12 cutedigi

cutedigi

    Advanced Member

  • Members
  • PipPipPip
  • 100 posts

Posted 12 February 2015 - 04:44 AM

I got back to playing with Xenomai since we'll need it for LinuxCnc. I just successfully compiled a kernel image patched with ipipe-linuxsun5i-3.4.29-r1.patch. 

Here's how I got there, though I didn't actually create the mmc card yet. I will do that next...

Follow instruction here.. http://www.pcduino.com/?p=957  up to the point of writing the mmc card.

A few notes about those instructions to save you some time:
     The compiler complained about libusb..
     

Code: [Select]

$ sudo apt-get install libusb-1.0-0

The instruction states:
     

Quote
On x86 ubuntu, install the following packages using apt-get:
 

However, the livesuit image will fail if this whole process is not done on an x_64 system. I've taken a liking to Linux Mint so I installed Mint 15 x_64 and started all over again. 

The above has to work without errors before you try to patch with iPipe.

Get this patch...  https://code.google....3.4.29-r1.patch

open the file in an editor like Pluma or Gedit...
All reference to "linux-sunxi-v3.4.29-r1" needs to be changed to "linux-sunxi". I used "Ctrl-h' and replaced all. 

I then placed the patch file into the main kernel directory I ran 'make' in before. 

cd into the linux-sunxi folder and execute the patch..
 

Code: [Select]

cd linux-sunxi
patch -p1 < ../ipipe-linuxsun5i-3.4.29-r1.patch
I received no errors

I then ..
 

Code: [Select]

cd ..
make

it ran again and complained a little about some warnings but kept on going without error. Then I wanted to see the Menuconfig so..
 

Code: [Select]

make linux-configthe menuconfig came up and had the extra iPipe & realtime configs. The other settings appeared to be there regarding Mali drivers and Sun4i. 

So I ran make again. Why? I'm not sure. It created the images like before I patched so I think it looks good so far. 

I checked in 'kernel/build/sun4i_defconfig-linux/arch/arm' and there was xenomai folder

I'm not sure what this means but I'll know more if I can successfully create the mmc and boot it on the PcDuino.

Does anyone know what tests I can run to check if this patch did anything? That is if it boots up cheesy.gif

mark



#13 cutedigi

cutedigi

    Advanced Member

  • Members
  • PipPipPip
  • 100 posts

Posted 12 February 2015 - 04:44 AM

I have to work through this...

Quote
2.1. Kernel stops after "Uncompressing Linux… done, booting the kernel."
This means that the kernel crashes before the console is enabled. You should enable the CONFIG_EARLY_PRINTK option. For some architectures (blackfin, x86, arm), enabling this option also requires passing the earlyprintk parameter on the kernel command line. See Documentation/kernel-parameters.txt for possible values.

For the ARM architecture, you have to enable CONFIG_DEBUG_KERNEL and CONFIG_DEBUG_LL in order to be able to enable CONFIG_EARLY_PRINTK.
 

...To see why it's crashing. From what I've read about iPipe porting, there are very particular settings on arm chips that may not work from chip to chip. The patch I'm messing with was created specifically for the A13 chip.  I believe tweaks are necessary to adopt to the A10.

I have lots more study but just the fact that the system lets me compile and that the image does build gives me some motivation to keep digging in. 

I'll modify the the config as stated above to try to see whats happening. This is what I am using as my guide...http://www.xenomai.o...core:ArmPorting



#14 cutedigi

cutedigi

    Advanced Member

  • Members
  • PipPipPip
  • 100 posts

Posted 12 February 2015 - 04:44 AM

Another note...

A similar effort is ongoing to port Linuxcnc to the RasPi. The approach is to offload the signal generation through SPI to an external PIC32 device. I have a Cerebot 32MX4 which has a Pic32MX460F512L that I was able to flash with PicNC found here..  https://code.google.com/p/picnc/



#15 chronoglass

chronoglass

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 11 June 2017 - 10:17 PM

I've been using grblweb, the new version laserweb seem slicker, but requires a full desktop environment.

I made a few fixes for the raspi over the last version and have done a pull request, but for now, here's what I'm using

 

https://github.com/chronoglass/grblweb

 

trying to hack in a plugin for safety (lock the machine unless it's on localhost, or a passcode is entered) and a plugin for pcb2gcode because, well, that's why I bought the thing in the first place. haha

 

late stealth edit:

I ditched grblweb in favor of CNCjs

https://www.npmjs.com/package/cncjs






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users