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 > 0000000000005370 b accum > 0000000000005358 b accum_diff > 00000000000053a0 b BCM2835_PERI_BASE > U cl...@@GLIBC_2.2.5 <javascript:> > 00000000000052d8 b comp_id > 00000000000052c0 b completed.7389 > w __cxa_finalize@@GLIBC_2.2.5 > 00000000000011a0 t deregister_tm_clones > 0000000000001210 t __do_global_dtors_aux > 0000000000004e08 t __do_global_dtors_aux_fini_array_entry > 00000000000050d0 d __dso_handle > 00000000000052e0 b dt > 0000000000004e10 d _DYNAMIC > U fcl...@@GLIBC_2.2.5 <javascript:> > U fe...@@GLIBC_2.2.5 <javascript:> > U fg...@@GLIBC_2.2.5 <javascript:> > 0000000000002fdc t _fini > U fo...@@GLIBC_2.2.5 <javascript:> > 0000000000001250 t frame_dummy > 0000000000004e00 t __frame_dummy_init_array_entry > 0000000000003760 r __FRAME_END__ > 00000000000012e0 t get_cpuinfo_revision > 0000000000001422 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 0x20000000 or 0x3F000000 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+...@googlegroups.com <javascript:>. > 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.