• @stephaneAG, ...the K was a low-hanging-fat-finger-of-a-lame-hand accident on the keyboard... it should just read HLHLHL. Thanks for pointing that out. I have though other crazy sequences used, where shorts and longs - SLSLSLS are mixed with R and G and B: see http://forum.espruino.com/comments/14358­074/ - lines 237..259 where I create red and green Morse code blinking when no other logging is available...

  • Do you have in mind a F4 board

    Not really. However http://www.espruino.com/STM32L496GDISCOV­ERY has a bunch of pins, is fast, and has loads of RAM.

    I was wondering if there's any USB stack on the nRF boards or the MDBT42Q ?

    No, there's no USB at all on the nRF52832. There is on the nRF52840, but apart from a few test builds I have nothing targeting those, and while I had a USB serial test, USB HID gamepad support is miles off.

    how to know if padding is allowed by GCC ?

    You could just print sizeof(your_struct)?

  • @allObjects haha ^^, it seemed so ;P
    On the link you posted, nice Morse code logging ! ( although it was a little cryptic for me at first ;) )

    @Gordon I just had a look at the beast .. indeed, but so sad that it doesn't offer every pins it provides on connectors :/ For my current needs & considering the price I guess an STM32F4DISCOVERY 'd be a nice fit if fully supported by Espruino :)

    On the nRF side, I just saw these & they seem quite neat ;)

    Since I don't know at all the nRF platform, I currently can't be of any help on these :/
    But hey, if the stack doesn't change ( too much ? ) between the kit I have yet to try & the said one, I'll be glad to digg the subject & try things out ;)

    For the struct size stuff, I tried the following quick test ( on laptop since I don't know yet how to get logs .. using stg else than leds now ;p ) and the result is the expected 6 ..

    // gcc test.c -Wall -o test.a
    // nb: could the makefile used  set some padding ?
    [#include](http://forum.espruino.com/sea­rch/?q=%23include) <stdio.h>
    [#include](http://forum.espruino.com/sea­rch/?q=%23include) <stdint.h> /* to use uint16_t & cie */
    int main(void){
    //int main(int argc, char *argv[]){
      struct gamepadHID_t
      {
        uint16_t buttons;
        //uint8_t buttons1;
        //uint8_t buttons2;
        int8_t left_x;
        int8_t left_y;
        int8_t right_x;
        int8_t right_y;
      };
      struct gamepadHID_t gamepadHID;
      gamepadHID.buttons = 0b0000000000000000;
      //gamepadHID.buttons1 = 0b00000000;
      //gamepadHID.buttons2 = 0b00000000;
      gamepadHID.left_x = 0b00000000;
      gamepadHID.left_y = 0b00000000;
      gamepadHID.right_x = 0b00000000;
      gamepadHID.right_y = 0b00000000;
    
      // debug
      printf("struct size (unsigned long): %lu \n", sizeof(gamepadHID) );
    
      return 0;
    }
    

    I'll try things out later today & report back :)

    & before I forget, I saw these links on some way to flash the HM-10 for custom HID stuff if I'm correct :)
    https://geekhack.org/index.php?topic=622­36.0

  • All right, I checked some things out, but it seems the F4 discovery board has been replaced by the STM32F407VG
    Looking for it online, I guess the following is fully ok with Espruino ? https://www.ebay.fr/itm/Stm32f4-Discover­y-Stm32f407-Cortex-m4-Development-Board-­st-link-V2/263287563871?hash=item3d4d296­65f:g:EsEAAOSwhUtbUwub:rk:3:pf:0

    Also, do you think the following could work ok ( maybe with some tweaks* ? ) https://www.ebay.fr/itm/STM32F407VGT6-AR­M-Cortex-M4-32-bit-MCU-Core-Discovery-De­velopment-Board-STM32F4/263106386751

    *reading the following's 1st page, is seems that the onboard chip is the same ? https://ucilnica.fri.uni-lj.si/pluginfil­e.php/21843/mod_resource/content/0/user_­manual_stm_discovery.pdf
    If so, I guess the latter would just require using another board ST-LINK embed programmer or USB-FTDI adapter to get things ready for dev, right ? ( I found this on the topic: https://www.stm32duino.com/viewtopic.php­?f=39&t=2666)

    I 'll have to check the diffs between the former & the latter ( don't know yet what 'T6' stands for ), but the 2nd one's pricing sparks my interest .. ;)
    On this, do you have the formulas to calculate how many jsvars 'd fit for a particular board's flash size ? ( I'd hugely prefer to Digg by myself & not take someone else's time for further investigations )

    thanks :)

  • I think the STM32F407VG discovery is probably just renamed? The one I linked to earlier (the L4) is something ST actually did some work on the Espruino port for though.

    I have no idea if the other board will work - you could try it, but you're on your own.

    For the vars, check out: https://github.com/espruino/Espruino/blo­b/master/README_BuildProcess.md#info

    And for the 52840, there are some posts on it already under the Porting to New Boards section: http://forum.espruino.com/microcosms/767­/

    Porting to other boards is interesting, but I'm afraid I'm super busy and I just can't afford to spend time helping in the porting process.

    Also even if you do get a port, I'm afraid I'm not taking the new board files into Espruino at the moment. I currently have over 50 board files which I have to maintain if anything in the build changes, and I just can't manage any more - even as-is it means I'm dissuaded from making changes to the build process that would improve Espruino.

  • Hi there !

    Thanks for all that :)

    Good to know for the L4 ( I bet the ST guys find Espruino very neat ;p )

    Understood ( for "on my own" on the other board ): so I'll have that kind of fun if trying to do so ;)

    For the 52840, I just checked the topic you linked to: this is pretty cool ( can't wait to test/help on that subject .. & get fully custom HID over USB/bluetooth :D ) !!

    For porting to other boards, I bet you're more than busy hence I'll rely on digging myself & the community to sort things out ;)

    On the build process / build changes / improving Espruino side of things, I wish I had a solution to this but aside from more people full time I have no clues on how to help that ( other than digging & helping myself when I can afford to do so :) ) :/

    On the "xbox360 passthrough" side of things, it seems the Teensy 3.6 offers usb host capability, so I'll try that as well as a tacky transistors+diodes setup ( just to see HOW it fails ;) )
    ( related post on dedicated forum: https://forum.pjrc.com/threads/54026-Tee­nsy-3-6-Xbox360-USB-Passthrough?p=189233­#post189233)

    I'll give back updates as I go :)
    Keep up the good work ++

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Espruino USB HID GamePad - v0.1a ready ! ( may also be Bluetooth & RN42 ready .. )

Posted by Avatar for stephaneAG @stephaneAG

Actions