Menu

#146 Motionsystem and spidev problem

Armadeus-3.4
closed-fixed
nobody
None
7
2018-08-09
2014-04-26
No

Hello,

I installed successfully the motionsystem version 0002:
http://www.embedded-wire.com/communaute/controleur-de-servomoteurs-fpga-sur-plate-forme-armadeus

But as soon as I use the SPI function as_devices/as_spi_msg, the servomotors doesn't move anymore. I have to reset APF9328.
I use Armadeus 3.4 , but I didn't see new modification on last version 5.3 or 6.0.

I identified the following function:
unsigned long long as_spi_msg(int aFd,
unsigned long long aMsg,
size_t aLen,
uint32_t aSpeed);
and especially the following command :
"status = ioctl(aFd, SPI_IOC_MESSAGE(1), xfer);"

It's very strange !
Could you test if you have the same problem ? Have you got an idea to solve it ?

Thanks in advance,
Christophe

Discussion

  • Christophe CHAUDELET

    Someone can test this to confirm this problem ?

     
  • Christophe CHAUDELET

    I've just made a new test with the last Armadeus version 6.0-git.
    I recreated completely a new virtual machine with Ubuntu 14.04.
    I made the compilation with xenomai / spidev / with the motionsystem ArmadeusServoDriver.
    I connected no electronic system, only the devlightv2.

    After login :
    # modprobe spidev
    # modprobe servo
    Armadeus FPGA R/C servo driver: Version 0.4
    Armadeus FPGA R/C servo driver: Magic ID OK 0X7207
    Armadeus FPGA R/C servo driver: Firmware version 0X4
    Armadeus FPGA R/C servo driver: 32 R/C servo(s) managed by the FPGA firmware
    # cd /sys/class/servo/servo0
    # echo '1' > enable
    => a signal is correct on the pin 1
    Then I execute an spi command using cpp program like the following:

    #include "ARMA_TestV01.hpp"
    #include <as_devices cpp="" as_spi.hpp="">
    #include <iostream>
    using namespace std;
    int main() {
    cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
    const char aSpidev_name = APF9328_SPI;
    unsigned char
    d = (unsigned char) aSpidev_name;
    AsSpi
    o=new AsSpi (d);
    int speed = o->getSpeed();
    cout << "speed=" << speed << endl;
    char data = CLEAR_COUNTER;
    unsigned long long result = o->msg((unsigned long long) data, sizeof(data), CLOCKSPEED);
    cout << "result=" << result << endl;
    return 0;
    }

    => As soon as I use msg() function, all fpga signals crash immediatly.

    Have you got a solution ?

    Best regards,
    Christophe.

     
  • Julien B aka Artemys

    Finally, I found some time to rootcause this problem. The GPIO choosen to be use by default by spidev ChipSelect (PORTB 18) is in conflict with FPGA's PROGRAM pin. The result is that when someone play with spidev on the APF9328, the FPGA is put in programming mode and loose all its configuration.
    In the next BSP release (6.0) we will move APF9328 spidev CS pin to CSI_DO (PORTA 4) instead of PORTB 18.

    Thanks for reporting the bug and sorry for the delay !

    Regards,
    Julien

     
  • Julien B aka Artemys

    • status: open --> closed-fixed
     

Log in to post a comment.