[beagleboard] accessing SPI registers gets me bus errors

2018-08-15 Thread Gerhard Hoffmann
Hi, all,

what I want to do is the following:

There is a LinearTechnology/AD LTC2500-32 ADC that can deliver up to
1Meg 32-Bit results per second on its slave SPI-Interface. Baud rate
can be 100MBit/sec. I could live with somewhat less, but would like to 
max it out as far as possible.

I want to read the data via SPI0. Collecting them by DMA might be possible,
but I see problems allocating large enough fixed buffers and much ado 
with physical/virtual adresses.

So I decided to use the PRU0 to do the fast work. In the 12 KB shared ram, 
there
will be 2  1KWord ping-pong-Buffers and a few words for 
command/status/handshake.
The PRU can simply do busy waiting; it has nothing else to do. No 
interrupts etc
needed.

The ARM CPU fetches 1Kword worth of data when a buffer gets full and moves 
it to virtual address land, where there is a lot of space & network access.

I can mmap() the shared buffer, the PRU data rams and the PRU instruction
rams and change / test them. (I cannot yet load the PRU program & start it,
but that is not the problem now.)

The problem is that I get bus errors when I access anything of the SPI 
interface.  There was some "Robotics" driver pre-installed that claimed all 
SPI
for itself, which I consider kinda unfriendly.

Blacklisting removed it, but it did not remove the bus errors.
What is the minimum I have to do to get access to the SPI registers?

I get no complaints when I mmap() the SPI0, but I get killed when I actually
access it.  Using devmem2 does the same.

--
root@beaglebone:/home/gerhard# devmem2 0x4803
Bus error

All existing SPI examples end with "now look at the slot entries" but 
kernel overlays are gone and going through the file system is MUCH too slow.

I could live with a userland wart, I need nothing with interrupts or a nice 
& tidy device driver.
At least for now.

-
root@beaglebone:/home/gerhard# inxi -v7
System:Host: beaglebone 
Kernel:  4.9.82-ti-r102 armv7l (32 bit gcc: 6.3.0) 
Console: tty 0
Distro: Debian GNU/Linux 9 (stretch) .

- 
root@beaglebone:/home/gerhard# lsmod
Module  Size  Used by
pruss_soc_bus   4788  0
evdev  13811  1
uio_pdrv_genirq 4205  0
uio11036  1 uio_pdrv_genirq
8021q  24278  0
garp7357  1 8021q
mrp 9301  1 8021q
stp 2686  1 garp
llc 6287  2 garp,stp
usb_f_mass_storage 51462  2
usb_f_acm   8610  2
u_serial   13482  3 usb_f_acm
usb_f_ecm  11619  2
usb_f_rndis26944  2
u_ether13962  2 usb_f_ecm,usb_f_rndis
libcomposite   55456  16 
usb_f_ecm,usb_f_acm,usb_f_mass_storage,usb_f_rndis
iptable_nat 2512  0
nf_conntrack_ipv4  12035  1
nf_defrag_ipv4  2016  1 nf_conntrack_ipv4
nf_nat_ipv4 6857  1 iptable_nat
nf_nat 18928  1 nf_nat_ipv4
nf_conntrack  117486  3 nf_conntrack_ipv4,nf_nat_ipv4,nf_nat
iptable_mangle  2303  0
iptable_filter  2453  0
pru_rproc  14966  0
pruss_intc  9092  1 pru_rproc
pruss  10889  1 pru_rproc
tieqep  9111  0
ip_tables  14529  3 iptable_mangle,iptable_filter,iptable_nat
x_tables   22165  3 iptable_mangle,ip_tables,iptable_filter

So, to repeat my question:

What is the minimum I have to do to get access to the SPI registers?

thanks and best regards,

Gerhard


-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/fed54861-d6f9-45dd-b2f1-7b9de005ab10%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] The build failed because the process exited too early.

2018-08-15 Thread Robert Nelson
On Wed, Aug 15, 2018 at 6:36 AM Ichrak Mansour
 wrote:

Why did you send 4 messages?

https://i.imgur.com/nHGmbh7.png

That's kinda rude..

>
> hen I run my application on the microSd ( having 4G ) on my Beaglebone, I get 
> this error :
>
> The build failed because the process exited too early. This probably means 
> the system ran out of memory or someone called `kill -9` on the process.

So you ran out of RAM and the OOM killer stopped it.. Add some swap.

sudo fallocate -l 512M /swap.file
sudo chmod 600 /swap.file
sudo mkswap /swap.file
sudo swapon /swap.file

> npm ERR! code ELIFECYCLE
> npm ERR! errno 1
> npm ERR! @coreui/coreui-free-react-admin-template@2.0.5 start-js: ` export 
> PORT=5000  && react-scripts start`
> npm ERR! Exit status 1
> npm ERR!
> npm ERR! Failed at the @coreui/coreui-free-react-admin-template@2.0.5 
> start-js script.
> npm ERR! This is probably not a problem with npm. There is likely additional 
> logging output above.
>
> npm ERR! A complete log of this run can be found in:
> npm ERR! /root/.npm/_logs/2018-08-15T11_19_14_856Z-debug.log

Did you open that file ^

>
> It is the problem of size of my microSD ?

Or the location of the moon..

Regards,

-- 
Robert Nelson
https://rcn-ee.com/

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CAOCHtYjYEpu36EW%2BfZvO5kEc36MGn1O-c6mP%3DX4br34CHRinfQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] Custom board with AM335x PHY not found

2018-08-15 Thread sam . abbas3
Yiling,

My schematics are similar to beaglebone, which you can see in my first 
post. So my REFCLK is not connected as its also not connected in beaglebone 
black. And yes I am getting 25MHz clock. PHYAD0 and PHYAD2 show 0V and 
PHYAD1 has 1.6V. 

Please see my boot log below for my custom image:

U-Boot 2018.03-dirty (Aug 14 2018 - 08:41:54 -0600)
 


CPU  : AM335X-GP rev 2.1

I2C:   ready

DRAM:  512 MiB  

No match for driver 'omap_hsmmc'

No match for driver 'omap_hsmmc'

Some drivers were not found
 
Reset Source: Power-on reset has occurred.  

RTC 32KCLK Source: External.

MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1  
 
Loading Environment from EXT4...

** Unable to use mmc 0:1 for loading the env **
 
Failed (-5)
 
Board: BeagleBone Black
 
 not set. Validating first E-fuse MAC  

BeagleBone Black:  
 
BeagleBone: cape eeprom: i2c_probe: 0x54:  
 
BeagleBone: cape eeprom: i2c_probe: 0x55:  
 
BeagleBone: cape eeprom: i2c_probe: 0x56:  
 
BeagleBone: cape eeprom: i2c_probe: 0x57:  
 
Net:   eth0: MII MODE  
 
Could not get PHY for cpsw: addr 0  

cpsw

Press SPACE to abort autoboot in 2 seconds  

board_name=[A335BNLT] ...  
 
board_rev=[000C] ...

switch to partitions #0, OK
 
mmc0 is current device  

SD/MMC found on device 0

** Bad device 0:2 0x8200 **
 
** Bad device 0:2 0x8200 **
 
switch to partitions #0, OK
 
mmc0 is current device  

Scanning mmc 0:1...
 
60946 bytes read in 8 ms (7.3 MiB/s)

gpio: pin 56 (gpio 56) value is 0  
 
gpio: pin 55 (gpio 55) value is 0  
 
gpio: pin 54 (gpio 54) value is 0  
 
gpio: pin 53 (gpio 53) value is 1  
 
switch to partitions #0, OK
 
mmc0 is current device  

gpio: pin 54 (gpio 54) value is 1  
 
Checking for: /uEnv.txt ...
 
186 bytes read in 3 ms (60.5 KiB/s)
 
gpio: pin 55 (gpio 55) value is 1  
 
Loaded environment from /uEnv.txt  
 
Importing environment from mmc ...  

Checking if uenvcmd is set ...  

gpio: pin 56 (gpio 56) value is 1  
 
Running uenvcmd ...
 
508 bytes read in 317 ms (15 MiB/s)
 
loading /am335x-boneblack.dtb ...  
 
60946 bytes read in 9 ms (6.5 MiB/s)

bootargs=console=ttyO0,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext4 
rootwait 
## Flattened Device Tree blob at 8800  
 
   Booting using the fdt blob at 0x8800
 
   Loading Device Tree to 

[beagleboard] The build failed because the process exited too early.

2018-08-15 Thread Ichrak Mansour
hen I run my application on the microSd ( having 4G ) on my Beaglebone, I 
get this error :

The build failed because the process exited too early. This probably means 
the system ran out of memory or someone called `kill -9` on the process.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @coreui/coreui-free-react-admin-template@2.0.5 start-js: ` export 
PORT=5000  && react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @coreui/coreui-free-react-admin-template@2.0.5 
start-js script.
npm ERR! This is probably not a problem with npm. There is likely 
additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-08-15T11_19_14_856Z-debug.log

It is the problem of size of my microSD ?

How can I fix that please ?

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/a5c80fac-8eb6-487c-95a1-8b39dca2ab8b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[beagleboard] The build failed because the process exited too early.

2018-08-15 Thread Ichrak Mansour
hen I run my application on the microSd ( having 4G ) on my Beaglebone, I 
get this error :

The build failed because the process exited too early. This probably means 
the system ran out of memory or someone called `kill -9` on the process.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @coreui/coreui-free-react-admin-template@2.0.5 start-js: ` export 
PORT=5000  && react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @coreui/coreui-free-react-admin-template@2.0.5 
start-js script.
npm ERR! This is probably not a problem with npm. There is likely 
additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-08-15T11_19_14_856Z-debug.log

It is the problem of size of my microSD ?

How can I fix that please ?

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/44cfdc2f-ec5d-4166-b397-fe71911ea649%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[beagleboard] The build failed because the process exited too early.

2018-08-15 Thread Ichrak Mansour
When I run my application on the microSd ( having 4G ) on my Beaglebone, I 
get this error :

The build failed because the process exited too early. This probably means 
the system ran out of memory or someone called `kill -9` on the process.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @coreui/coreui-free-react-admin-template@2.0.5 start-js: ` export 
PORT=5000  && react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @coreui/coreui-free-react-admin-template@2.0.5 
start-js script.
npm ERR! This is probably not a problem with npm. There is likely 
additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-08-15T11_19_14_856Z-debug.log

It is the problem of size of my microSD ?

How can I fix that please ?

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/edff5659-f70c-4b04-afd7-c751cef43acc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[beagleboard] The build failed because the process exited too early.

2018-08-15 Thread Ichrak Mansour
When I run my application on the microSd ( having 4G ) on my Beaglebone, I 
get this error :

The build failed because the process exited too early. This probably means 
the system ran out of memory or someone called `kill -9` on the process.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @coreui/coreui-free-react-admin-template@2.0.5 start-js: ` export 
PORT=5000  && react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @coreui/coreui-free-react-admin-template@2.0.5 
start-js script.
npm ERR! This is probably not a problem with npm. There is likely 
additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-08-15T11_19_14_856Z-debug.log

It is the problem of size of my microSD ?

How can I fix that please ?








-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/92287df6-07e0-4866-8e6e-3f602c733b8b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[beagleboard] Re: PRUs realtime data acquisition, I2C bus and ADC

2018-08-15 Thread Hugh Frater
Did you figure out access to the i2c registers from within the PRU? I'm 
working on that at the moment and could use a header file or similar...

On Tuesday, 13 February 2018 17:49:23 UTC, pierric...@gadz.org wrote:
>
> Hi all, 
>
> I am trying to use the PRUs for real time data acquisition on the 
> Beaglebone black (Linux debian 4.9.45-ti-r57). I have set up the PRU with 
> remoteproc and RPMsg; everything is working fine. 
> The first time, I successfully captured data with the PRU using the SPI 
> protocol and bit banging, and I have sent them to the ARM with RPMsg. 
>
> Now I want to do the same thing using the I2C protocol, which left me with 
> some questions: 
> - Is it possible to use the on-board I2C bus with the PRUs? 
> - If not, I will enable the pull-up resistor on a GPIO pins using a custom 
> device tree. But after that, I do not really understand how I can read and 
> write the SDA line for I2C? (Contrary to the SPI protocol, I won't have 
> Data In and  Data out lines but only one SDA line).
>
> My final goal will be to use the on-board ADC. There is already a very 
> interesting project PRUADC that captures data using an external ADC. I 
> would like to use the on-board ADC, is there any way to do it ? (I am not 
> afraid of going into complex stuff). 
>
> Thanks,
>
>
> Pierrick 
>
>
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/7ca6b77b-3f58-4b10-9ad1-20458e8e3efd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] Custom board with AM335x PHY not found

2018-08-15 Thread Yiling Cao
hardware side: is your REFCLK connected to PHY and am335x? 25MHz clock can
be detected? and 2 PHY ADDR pins stable while mdio probing?

uboot toggle reset example can be found here:
https://github.com/c2h2/aria-uboot/blob/7504def7830aaf4e8478ad098d8eec1951d5ccb6/board/ti/am335x/board.c#L505

On Wed, Aug 15, 2018 at 4:27 AM Robert Nelson 
wrote:

> On Tue, Aug 14, 2018 at 3:24 PM  wrote:
> >
> > Hi Frank,
> >
> > Actually I am able to toggle GPIO now, but the GPIO is getting reset at
> Kernel. PHY reset is suppose to happen at startup on u-boot. How can I
> toggle GPIO at startup?
>
> No the dts file your tweaking would cause the phy reset to occur in
> the kernel startup..
>
> For u-boot, you need to modify the u-boot sources..
>
> Regards,
>
> --
> Robert Nelson
> https://rcn-ee.com/
>
> --
> For more options, visit http://beagleboard.org/discuss
> ---
> You received this message because you are subscribed to the Google Groups
> "BeagleBoard" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to beagleboard+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/beagleboard/CAOCHtYgWnyZH9yk0XX6GYkuwotOGv9%3DX%2BTV3htmy%2BhQ7VtR6qw%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Yiling Cao
http://umine.io/ 
http://ariaboard.com/
http://shanghainovotech.com/

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CAMMUdpL201Vy26bCNS1Q5MPS0_LKArSnUe6fYwo5jzHKLdwZDQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] header file for CCSv6 & PRU

2018-08-15 Thread Hugh Frater
Interesting, thanks Charles...

FWIW, I've been working with the eQEP hardware from within the PRU and that 
also lacks a header file, however, some example TI code (which I am using 
in my project) shows:

/* Non-CT register defines */
#define CM_PER_EPWMSS1 (*((volatile unsigned int *)0x44E000CC))

Coupled with:

#include 

As being good enough to allow subsequent access and control of the PWMSS 
from within the PRU... I have added a #define for the base address of I2C2 
but I now need to find if there is a header file to go with. I'll do some 
searching.

On Wednesday, 15 August 2018 03:30:01 UTC+1, Charles Steinkuehler wrote:
>
> On 8/14/2018 6:29 AM, Hugh Frater wrote: 
> > Does anyone know the header file I need to include to get access to the 
> > i2c2 control registers from within the PRU subsystem? Having a hard time 
> > getting any info and my google-foo is usually pretty decent... 
>
> AFAIK, there are no "standard" headers for accessing physical hardware 
> like the i2c buses from the PRU.  Even the Linux kernel generally 
> mixes this sort of thing between header files (for the bit definitions 
> and "structure" of the control registers) and the device tree (for 
> base addresses, IRQ values, etc). 
>
> Probably the closest you'll find is something from the TI bare-metal code: 
>
> http://processors.wiki.ti.com/index.php/StarterWare 
>
> -- 
> Charles Steinkuehler 
> cha...@steinkuehler.net  
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/c2ed5676-e76b-4227-8e87-f249db3eeed1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] Re: beaglebone g_printer module and windows host

2018-08-15 Thread 李林钰
Thanks, I will try it later.

Robert Nelson  于 2018年8月15日周三 00:17写道:

> On Tue, Aug 14, 2018 at 11:12 AM 李林钰  wrote:
> >
> > Did you mean mknod g_printer nod?
> >
> > root@beaglebone:/lib/modules/4.4.30-ti-r64/kernel/drivers/usb/gadget/legacy#
> file g_printer.ko
> > g_printer.ko: ELF 32-bit LSB relocatable, ARM, EABI5 version 1 (SYSV),
> BuildID[sha1]=146c9f734be9bcf8b24a26b3368a7443bfbab22e, not stripped
>
> Okay, it's built/installed
>
> >
> > I flashed bone-debian-8.6-iot-armhf-2016-11-06-4gb.img from
> https://beagleboard.org/latest-images.
>
> did you disable the currently loaded configfs gadget? by default
> that's loaded thru the systemd service script: "generic-board-startup"
>
> Regards,
>
> --
> Robert Nelson
> https://rcn-ee.com/
>
> --
> For more options, visit http://beagleboard.org/discuss
> ---
> You received this message because you are subscribed to the Google Groups
> "BeagleBoard" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to beagleboard+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/beagleboard/CAOCHtYjbGnVSndSbwS1Zda0%3DF9HfJOQE%3DtLjNa1G-6YJa5g%2BCA%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CAG%2BXAu74siudh5cY7u6eb%2BZbSNtPm9mhmjSQiPmXHo4_fVR8CQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.