Re: [Machinekit] using hal_spi module

2018-09-30 Thread mngr
It will probably take me more of a evening because the next couple of days is 
already full. Maybe I will test your version and then make another pr to unify 
hal_spi.h and bcm2835.h

-- 
website: http://www.machinekit.io blog: http://blog.machinekit.io github: 
https://github.com/machinekit
--- 
You received this message because you are subscribed to the Google Groups 
"Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to machinekit+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/machinekit.
For more options, visit https://groups.google.com/d/optout.


Re: [Machinekit] using hal_spi module

2018-09-30 Thread schoone...@gmail.com

  
  
OK, 
Hear from you in a bit

On 30/09/18 18:15, mngr wrote:


  
I lacked attention, I thought you imported cpuinfo.h
rebuilded and now it runs, but I still need to edit
  something more to make it work

nm shows that both get_cpuinfo_revision() and
  get_rpi_revision() are defined


anyway, it reads correctly giving number cores as 4 and
  revision as 4.

I will give some time trying to patch my version, if it is
  too hard I will clone and test yours





Il giorno domenica 30 settembre 2018 18:23:39 UTC+2, Schooner ha
scritto:

   
On 30/09/18 16:59, mngr wrote:


  
A young guy just learned how beautiful commit diffs
  are



here is a link to the diffs!

https://github.com/machinekit/machinekit/compare/master...mngr0:master



I have been very sticky to the workings in
  hal_gpio.c,
and the changes in hal_spi.h are not really
  necessary, but I think it should be removed, to be
  more consistent with hal_gpio, and to use bcm2835.h
  more (this requires work on hal_spi.c)



it compiles, but while executing it has some
  problem in finding get_rpi_revision,
  


That should not be so

You got that error because you only included cpu_info.h but
nothing else.
I included the actual code by using
#include "cpu_info.c"

When I do a check on the module my code produced and the
functions defined I get

root@INTEL-i7:/usr/src/machinekit/rtlib/rt-preempt# nm
-C hal_spi.so
5370 b accum
5358 b accum_diff
53a0 b BCM2835_PERI_BASE
 U cl...@@GLIBC_2.2.5
52d8 b comp_id
52c0 b completed.7389
 w __cxa_finalize@@GLIBC_2.2.5
11a0 t deregister_tm_clones
1210 t __do_global_dtors_aux
4e08 t __do_global_dtors_aux_fini_array_entry
50d0 d __dso_handle
52e0 b dt
4e10 d _DYNAMIC
 U fcl...@@GLIBC_2.2.5
 U fe...@@GLIBC_2.2.5
 U fg...@@GLIBC_2.2.5
2fdc t _fini
 U fo...@@GLIBC_2.2.5
1250 t frame_dummy
4e00 t __frame_dummy_init_array_entry
3760 r __FRAME_END__
12e0 t get_cpuinfo_revision
1422 t get_rpi_revision


So get_cpuinfo_revision() and get_rpi_revision()
are both in the text section of the module and are local to
it.

If they were undefined they would have a U in front of them

Are you somehow trying to run your old module again?

Run the nm command above on your module.


  
 
any suggestion to help hal_spi dinamically link
  this?



maybe a issue or pull request on github may be a
  more relevant place for this discussion?





Il giorno domenica 30 settembre 2018 16:22:51 UTC+2,
Schooner ha scritto:

   See https://github.com/ArcEye/machinekit/tree/hal_spi_base

I have used the simplest strategy.  
As only the _PERI_BASE seems to be different, I have
changed the #define to an unsigned int variable.

This is then set to either 0x2000 or 0x3F00
depending upon version detected.

Just added code for number_of_cores() and included
cpu_info.c to get the others.

It builds but needs testing

If you get problems, add some DBG prints to see what

Re: [Machinekit] using hal_spi module

2018-09-30 Thread mngr
I lacked attention, I thought you imported cpuinfo.h
rebuilded and now it runs, but I still need to edit something more to make 
it work
nm shows that both get_cpuinfo_revision() and get_rpi_revision() are defined

anyway, it reads correctly giving number cores as 4 and revision as 4.
I will give some time trying to patch my version, if it is too hard I will 
clone and test yours


Il giorno domenica 30 settembre 2018 18:23:39 UTC+2, Schooner ha scritto:
>
>
> On 30/09/18 16:59, mngr wrote:
>
> A young guy just learned how beautiful commit diffs are
>
> here is a link to the diffs!
> https://github.com/machinekit/machinekit/compare/master...mngr0:master
>
> I have been very sticky to the workings in hal_gpio.c,
> and the changes in hal_spi.h are not really necessary, but I think it 
> should be removed, to be more consistent with hal_gpio, and to use 
> bcm2835.h more (this requires work on hal_spi.c)
>
> it compiles, but while executing it has some problem in finding 
> get_rpi_revision,
>
>
> That should not be so
>
> You got that error because you only included cpu_info.h but nothing else.
> I included the actual code by using
> #include "cpu_info.c"
>
> When I do a check on the module my code produced and the functions defined 
> I get
>
> root@INTEL-i7:/usr/src/machinekit/rtlib/rt-preempt# nm -C hal_spi.so
> 5370 b accum
> 5358 b accum_diff
> 53a0 b BCM2835_PERI_BASE
>  U cl...@@GLIBC_2.2.5 
> 52d8 b comp_id
> 52c0 b completed.7389
>  w __cxa_finalize@@GLIBC_2.2.5
> 11a0 t deregister_tm_clones
> 1210 t __do_global_dtors_aux
> 4e08 t __do_global_dtors_aux_fini_array_entry
> 50d0 d __dso_handle
> 52e0 b dt
> 4e10 d _DYNAMIC
>  U fcl...@@GLIBC_2.2.5 
>  U fe...@@GLIBC_2.2.5 
>  U fg...@@GLIBC_2.2.5 
> 2fdc t _fini
>  U fo...@@GLIBC_2.2.5 
> 1250 t frame_dummy
> 4e00 t __frame_dummy_init_array_entry
> 3760 r __FRAME_END__
> 12e0 t get_cpuinfo_revision
> 1422 t get_rpi_revision
> 
>
> So *get_cpuinfo_revision(*) and *get_rpi_revision()* are both in the text 
> section of the module and are local to it.
>
> If they were undefined they would have a U in front of them
>
> Are you somehow trying to run your old module again?
>
> Run the nm command above on your module.
>
> any suggestion to help hal_spi dinamically link this?
>
> maybe a issue or pull request on github may be a more relevant place for 
> this discussion?
>
>
> Il giorno domenica 30 settembre 2018 16:22:51 UTC+2, Schooner ha scritto: 
>>
>> See https://github.com/ArcEye/machinekit/tree/hal_spi_base
>>
>> I have used the simplest strategy.  
>> As only the _PERI_BASE seems to be different, I have changed the #define 
>> to an unsigned int variable.
>>
>> This is then set to either 0x2000 or 0x3F00 depending upon 
>> version detected.
>>
>> Just added code for number_of_cores() and included cpu_info.c to get the 
>> others.
>>
>> It builds but needs testing
>>
>> If you get problems, add some DBG prints to see what revision and number 
>> of cores is being returned
>>
>> regards
>>
>> On 29/09/18 17:56, mngr wrote:
>>
>> https://github.com/mngr0/machinekit
>>
>>
>> Il giorno sabato 29 settembre 2018 18:50:47 UTC+2, Schooner ha scritto: 
>>>
>>> Can you link to a github repo with this in?  I will look tomorrow.
>>>
>>> You have probably declared something as extern or otherwise done enough 
>>> to satisfy the compiler, but not actually linked it or similar.
>>>
>>> Each driver probably needs to have all the routines and info within it.
>>>
>>> On 29/09/18 17:41, mngr wrote:
>>>
>>> i have copied all the function and recompiled,
>>> now when i run realtime start; halcmd loadrt hal_spi an error says 
>>> do_load_cmd: dlopen: /home/pi/machinekit/rtlib/rt-preempt/hal_spi.so: 
>>> undefined symbol: get_rpi_revision
>>> rpath=/home/pi/machinekit/rtlib/rt-preempt:/home/pi/machinekit/lib
>>>
>>> it does not happen if I run halcmd loadrt hal_gpio
>>>
>>>
>>> then I have seen that there is bcm26835.h that unify all the useful 
>>> definitions, it would be nice if hal_spi.h was removed since it duplicates 
>>> definitions.
>>> the only problem is that hal_spi.h defines the register addresses, while 
>>> bcm2835.h defines offsets, so a lot of hal_spi.c would have to be modified.
>>>
>>>
>>>
>>> Il giorno venerdì 28 settembre 2018 19:45:13 UTC+2, XL600R ha scritto: 

 On 28.09.18 17:16, schoo...@gmail.com wrote: 
 > It can only have been written for v1 or v2, probably not v2B given 
 its date of writing. 
 > I have not heard anything of the guy who wrote it for some years 
 either. 

 Hi, 

 Gemi has wrote this driver for a particular board 
  https://github.com/kinsamanka/PICnc-V2/wiki . 
 I can't 

Re: [Machinekit] using hal_spi module

2018-09-30 Thread schoone...@gmail.com

  
  

On 30/09/18 16:59, mngr wrote:


  
A young guy just learned how beautiful commit diffs are



here is a link to the diffs!

https://github.com/machinekit/machinekit/compare/master...mngr0:master



I have been very sticky to the workings in hal_gpio.c,
and the changes in hal_spi.h are not really necessary, but
  I think it should be removed, to be more consistent with
  hal_gpio, and to use bcm2835.h more (this requires work on
  hal_spi.c)



it compiles, but while executing it has some problem in
  finding get_rpi_revision,
  


That should not be so

You got that error because you only included cpu_info.h but nothing
else.
I included the actual code by using
#include "cpu_info.c"

When I do a check on the module my code produced and the functions
defined I get

root@INTEL-i7:/usr/src/machinekit/rtlib/rt-preempt# nm -C hal_spi.so
5370 b accum
5358 b accum_diff
53a0 b BCM2835_PERI_BASE
 U close@@GLIBC_2.2.5
52d8 b comp_id
52c0 b completed.7389
 w __cxa_finalize@@GLIBC_2.2.5
11a0 t deregister_tm_clones
1210 t __do_global_dtors_aux
4e08 t __do_global_dtors_aux_fini_array_entry
50d0 d __dso_handle
52e0 b dt
4e10 d _DYNAMIC
 U fclose@@GLIBC_2.2.5
 U feof@@GLIBC_2.2.5
 U fgets@@GLIBC_2.2.5
2fdc t _fini
 U fopen@@GLIBC_2.2.5
1250 t frame_dummy
4e00 t __frame_dummy_init_array_entry
3760 r __FRAME_END__
12e0 t get_cpuinfo_revision
1422 t get_rpi_revision


So get_cpuinfo_revision() and get_rpi_revision() are
both in the text section of the module and are local to it.

If they were undefined they would have a U in front of them

Are you somehow trying to run your old module again?

Run the nm command above on your module.


  
 
any suggestion to help hal_spi dinamically link this?



maybe a issue or pull request on github may be a more
  relevant place for this discussion?





Il giorno domenica 30 settembre 2018 16:22:51 UTC+2, Schooner ha
scritto:

   See https://github.com/ArcEye/machinekit/tree/hal_spi_base

I have used the simplest strategy.  
As only the _PERI_BASE seems to be different, I have changed
the #define to an unsigned int variable.

This is then set to either 0x2000 or 0x3F00
depending upon version detected.

Just added code for number_of_cores() and included
cpu_info.c to get the others.

It builds but needs testing

If you get problems, add some DBG prints to see what
revision and number of cores is being returned

regards

On 29/09/18 17:56, mngr wrote:


  
https://github.com/mngr0/machinekit



Il giorno sabato 29 settembre 2018 18:50:47 UTC+2,
Schooner ha scritto:

   Can you link to
a github repo with this in?  I will look tomorrow.

You have probably declared something as extern or
otherwise done enough to satisfy the compiler, but
not actually linked it or similar.

Each driver probably needs to have all the routines
and info within it.

On 29/09/18 17:41, mngr wrote:


  
i have copied all the function and
  recompiled,
now when i run realtime start; halcmd
  loadrt hal_spi an error says 


  
  do_load_cmd: dlopen: /home/pi/machinekit/rtlib/rt-preempt/hal_spi.so: undefined symbol: get_rpi_revision
  rpath=/home/pi/machinekit/rtlib/rt-preempt:/home/pi/machinekit/lib






Re: [Machinekit] using hal_spi module

2018-09-30 Thread mngr
A young guy just learned how beautiful commit diffs are

here is a link to the diffs!
https://github.com/machinekit/machinekit/compare/master...mngr0:master

I have been very sticky to the workings in hal_gpio.c,
and the changes in hal_spi.h are not really necessary, but I think it 
should be removed, to be more consistent with hal_gpio, and to use 
bcm2835.h more (this requires work on hal_spi.c)

it compiles, but while executing it has some problem in finding 
get_rpi_revision,
any suggestion to help hal_spi dinamically link this?

maybe a issue or pull request on github may be a more relevant place for 
this discussion?


Il giorno domenica 30 settembre 2018 16:22:51 UTC+2, Schooner ha scritto:
>
> See https://github.com/ArcEye/machinekit/tree/hal_spi_base
>
> I have used the simplest strategy.  
> As only the _PERI_BASE seems to be different, I have changed the #define 
> to an unsigned int variable.
>
> This is then set to either 0x2000 or 0x3F00 depending upon version 
> detected.
>
> Just added code for number_of_cores() and included cpu_info.c to get the 
> others.
>
> It builds but needs testing
>
> If you get problems, add some DBG prints to see what revision and number 
> of cores is being returned
>
> regards
>
> On 29/09/18 17:56, mngr wrote:
>
> https://github.com/mngr0/machinekit
>
>
> Il giorno sabato 29 settembre 2018 18:50:47 UTC+2, Schooner ha scritto: 
>>
>> Can you link to a github repo with this in?  I will look tomorrow.
>>
>> You have probably declared something as extern or otherwise done enough 
>> to satisfy the compiler, but not actually linked it or similar.
>>
>> Each driver probably needs to have all the routines and info within it.
>>
>> On 29/09/18 17:41, mngr wrote:
>>
>> i have copied all the function and recompiled,
>> now when i run realtime start; halcmd loadrt hal_spi an error says 
>> do_load_cmd: dlopen: /home/pi/machinekit/rtlib/rt-preempt/hal_spi.so: 
>> undefined symbol: get_rpi_revision
>> rpath=/home/pi/machinekit/rtlib/rt-preempt:/home/pi/machinekit/lib
>>
>> it does not happen if I run halcmd loadrt hal_gpio
>>
>>
>> then I have seen that there is bcm26835.h that unify all the useful 
>> definitions, it would be nice if hal_spi.h was removed since it duplicates 
>> definitions.
>> the only problem is that hal_spi.h defines the register addresses, while 
>> bcm2835.h defines offsets, so a lot of hal_spi.c would have to be modified.
>>
>>
>>
>> Il giorno venerdì 28 settembre 2018 19:45:13 UTC+2, XL600R ha scritto: 
>>>
>>> On 28.09.18 17:16, schoo...@gmail.com wrote: 
>>> > It can only have been written for v1 or v2, probably not v2B given its 
>>> date of writing. 
>>> > I have not heard anything of the guy who wrote it for some years 
>>> either. 
>>>
>>> Hi, 
>>>
>>> Gemi has wrote this driver for a particular board 
>>>  https://github.com/kinsamanka/PICnc-V2/wiki . 
>>> I can't believe that it is very useful for someone else. 
>>> IMHO the nomenclature isn't overly happy. 
>>> A little bit to general. ;) 
>>>
>>> BR 
>>>
>>
>> I need a way to write commanded velocity on the spi, my bigger problem 
>> wiill be on the spi-slave, and this seems to me a pretty easy protocol to 
>> implement 
>>  
>> -- 
>> website: http://www.machinekit.io blog: http://blog.machinekit.io 
>> github: https://github.com/machinekit
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Machinekit" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to machinekit+...@googlegroups.com.
>> Visit this group at https://groups.google.com/group/machinekit.
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>> -- 
> website: http://www.machinekit.io blog: http://blog.machinekit.io github: 
> https://github.com/machinekit
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Machinekit" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to machinekit+...@googlegroups.com .
> Visit this group at https://groups.google.com/group/machinekit.
> For more options, visit https://groups.google.com/d/optout.
>
>
>

-- 
website: http://www.machinekit.io blog: http://blog.machinekit.io github: 
https://github.com/machinekit
--- 
You received this message because you are subscribed to the Google Groups 
"Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to machinekit+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/machinekit.
For more options, visit https://groups.google.com/d/optout.


Re: [Machinekit] using hal_spi module

2018-09-30 Thread schoone...@gmail.com

  
  
See https://github.com/ArcEye/machinekit/tree/hal_spi_base

I have used the simplest strategy.  
As only the _PERI_BASE seems to be different, I have changed the
#define to an unsigned int variable.

This is then set to either 0x2000 or 0x3F00 depending upon
version detected.

Just added code for number_of_cores() and included cpu_info.c to get
the others.

It builds but needs testing

If you get problems, add some DBG prints to see what revision and
number of cores is being returned

regards

On 29/09/18 17:56, mngr wrote:


  
https://github.com/mngr0/machinekit



Il giorno sabato 29 settembre 2018 18:50:47 UTC+2, Schooner ha
scritto:

   Can you link to a
github repo with this in?  I will look tomorrow.

You have probably declared something as extern or otherwise
done enough to satisfy the compiler, but not actually linked
it or similar.

Each driver probably needs to have all the routines and info
within it.

On 29/09/18 17:41, mngr wrote:


  
i have copied all the function and recompiled,
now when i run realtime start; halcmd loadrt
  hal_spi an error says 


  
  do_load_cmd: dlopen: /home/pi/machinekit/rtlib/rt-preempt/hal_spi.so: undefined symbol: get_rpi_revision
  rpath=/home/pi/machinekit/rtlib/rt-preempt:/home/pi/machinekit/lib





it does not happen if I run halcmd loadrt hal_gpio




then I have seen that there is bcm26835.h that
  unify all the useful definitions, it would be nice if
  hal_spi.h was removed since it duplicates definitions.
the only problem is that hal_spi.h defines the
  register addresses, while bcm2835.h defines offsets,
  so a lot of hal_spi.c would have to be modified.






Il giorno venerdì 28 settembre 2018 19:45:13 UTC+2,
XL600R ha scritto:
On 28.09.18 17:16, schoo...@gmail.com
  wrote: 
  > It can only have been written for v1 or v2,
  probably not v2B given its date of writing. 
  > I have not heard anything of the guy who wrote it
  for some years either. 
  
  Hi, 
  
  Gemi has wrote this driver for a particular board 
   https://github.com/kinsamanka/PICnc-V2/wiki
  . 
  I can't believe that it is very useful for someone
  else. 
  IMHO the nomenclature isn't overly happy. 
  A little bit to general. ;) 
  
  BR 



I need a way to write commanded velocity on the
  spi, my bigger problem wiill be on the spi-slave, and
  this seems to me a pretty easy protocol to implement 

 
  
  -- 
  website: http://www.machinekit.io blog: http://blog.machinekit.io github: https://github.com/machinekit
  --- 
  You received this message because you are subscribed to
  the Google Groups "Machinekit" group.
  To unsubscribe from this group and stop receiving emails
  from it, send an email to machinekit+...@googlegroups.com.
  Visit this group at https://groups.google.com/group/machinekit.
  For more options, visit https://groups.google.com/d/optout.


  

  
  -- 
  website: http://www.machinekit.io
  blog: http://blog.machinekit.io
  github: https://github.com/machinekit
  --- 
  You received this message because you are subscribed to the Google
  Groups "Machinekit" group.
  To unsubscribe from this group and stop receiving emails from it,
  send an email to machinekit+unsubscr...@googlegroups.com.
  Visit this group at https://groups.google.com/group/machinekit.
  For more options, visit https://groups.google.com/d/optout.


  




-- 
website: http://www.machinekit.io blog: http://blog.machinekit.io github: https://github.com/machinekit
--- 
You received this message because you are subscribed to