Introductory Tutorial for K210 Newbie



  • Hello,
    I am looking for some introductory (i.e. hands-on exercises) for the following boards:

    • Sipeed Maixduino
    • Grove AI HAT

    It is my understanding that both boards use Kendryte K210 which can be leveraged through Arduino IDE (and also separately/independently Python for AI HAT).

    Is there a K210 library for Arduino (I'm using v1.8.9 IDE) that I could install in my dev environment to test the two boards mentioned above with very, very simple (a la Hello World) exercises. My intention is to understand if I have the correct library/toolchain on my desktop (viz. Ubuntu 19.04) for the test exercises.

    The manufacturers of the both boards have asked me to contact Kendryte. My attempts to elicit a response from Kendryte have failed. I am hoping that someone outside the company will read this note and help me to move along the development path.

    Any advice (or even criticism) will be appreciated. Reading all the publications, the chipset seems to have potential. It is a pity that my inexperience is preventing me from understanding how to do even simple tests. Perhaps someone will be kind enough to suggest a self-study path so that I can ramp up my training with Kendryte.

    Xie xie.



  • @matha said in Introductory Tutorial for K210 Newbie:

    Which one (ttyUSB0 or ttyUSB1) should I use to flash your firmware to the Maixduino? I'm ready to use your pre-built firmware. ☺

    You can try either one, one is connected to the K210 (probably ttyUSB0, as I don't have the board, I'm not shure), the other one to the ESP32. You won't brick anything.



  • @loboris

    Hello,

    Please permit another newbie question (because I don't want to brick anything inadvertently). I see the following entries for the ttyUSB listings:

    $ lsusb
    $ ls /dev/ttyUSB*
    ls: cannot access '/dev/ttyUSB*': No such file or directory
    $ ls -l /dev/ttyUSB*
    crw-rw----+ 1 root plugdev 188, 0 Aug 22 09:07 /dev/ttyUSB0
    crw-rw----+ 1 root plugdev 188, 1 Aug 22 09:07 /dev/ttyUSB1
    $ lsusb
    Bus 001 Device 013: ID 0403:6010 Future Technology Devices International, Ltd FT2232C/D/H Dual UART/FIFO IC
    $
    

    Which one (ttyUSB0 or ttyUSB1) should I use to flash your firmware to the Maixduino? I'm ready to use your pre-built firmware. ☺

    Kind regards.

    N.B. I have omitted the 14+ lines of output from the lsusb command for other devices that are presumably irrelevant for this discussion.



  • @loboris Hello again!

    Most certainly, I will give it a test based on your suggestion. Please allow me some time (i.e. this weekend) to get back to you.

    Really, really appreciate your continuing interest in helping me out.

    Kind regards.



  • @matha

    Can you try to to flash my MicroPython_K210 to the Maixduino board and see if it is working.
    You can use the prebuilt firmware first, than you can try to build the firmware yourself later.

    In case of any problem you can report it at repository issue tracker, I'll be glad to analyze the issue and try to solve it.

    For more information on how to use it you can consult the Wiki.



  • hello matha,

    I have experienced Maixduino.
    The standard blink led example works. I don't see any led on the board but testing pin 13 show that the test is ok.
    The mobilenetv1 is also ok, objet recognition is not very good and I have to understand why but it works.

    Usbc doesn't connect every time, this is a bit tricky.
    I have used a usba/usbc converter and with that it is fine.

    versions :
    host : windows10 on dell 5530
    arduino IDE version : 1.8.9
    board manager : Maixduino(k210) by sipeed version 0.3.10

    Maixduino install documentation : https://maixduino.sipeed.com/en/get_started/install.html
    There is no mention of maixduino board in the doc but the install process is ok for maixduino.

    As a user of maixduino, i look preferably on http://bbs.sipeed.com

    hope it help.



  • One question, did you or you did not change Tools->Programmer to k-flash?
    I am using maixduino board with success since beginning.



  • @loboris Thanks again very much. Appreciate your efforts in going the distance to assist me. I understand that the GitHub code (that you reference) is maintained by Sipeed but what can I do if Sipeed summarily closes the issue without providing a test case and informing me that the ball is in someone else's court.

    I hope I have not caused any misunderstanding owing to my ignorance about matters other than writing Arduino code. The latter I can do but the rest is still beyond my skill level.

    When I originally posted my issue at the Sipeed forum, I got an immediate reply from another person with the same predicament but also the same approach as yours because he had both boards - the one that you have and the one that I have. He wished me best of luck! ☹

    I'll discard the two boards that I have. As I remarked to Sipeed and Seeed, I don't "want my money back. I simply want a path to test RISC-V." I will purchase the board you have used successfully and repeat the cycle. This way I can be more confident in emulating your success.

    Once again thank you very much for you assistance.

    Kind regards.



  • @matha
    Arduino uses the Kendryte Standalone SDK and the Kendryte Toolchain. Both are the the latest version and both are downloaded when you install the board in Arduino.
    If you are able to successfully compile your program, than nothing is wrong with them.
    As I understand you only have issues uploading (flashing) the created binary to the board. That can be caused by the fact that the Maixduino board uses a different USBtoSerial chip (CH552T) than Maix-Bit and Maix-M1 which I have (CH340C).
    It looks the issue is with kflash.py (the upload program).
    You may find some help on on the Maixduino GitHub repository:
    https://github.com/sipeed/Maixduino/issues/19#issuecomment-505797383
    https://github.com/sipeed/Maixduino/issues/19
    https://github.com/sipeed/platform-kendryte210/issues/12

    You can try to use standalone flashing program like Kflash-gui to flash the compiled binary.
    First export it from your sketch: Sketch->Export compiled Binary.

    Support from Kendryte is far from good, but in this case I don't think they could (or should) help.



  • @loboris Thanks for taking the extra steps to reassure me but I have to beg to differ since both Sipeed and Seeed have confirmed in their closing comments (for the issue reports that I logged at their respective forum) that the two boards, Maixduino and AI HAT respectively, have issues with the Kendryte K210 library. I clearly understand your assistance and I appreciate it.

    Yes, Arduino IDE detects both boards and the correct ports for each. I set the programmer as described in the documentation. These things I have done and checked over and over again.

    The fact that nobody at Kendryte is able to respond (as a matter of professional courtesy) authoritatively to my inquiry is a bigger issue, of course.

    Kind regards.

    P.S. Which version of the K210 library did you use?



  • I'm not using Arduino, but for test I've installed it (ver 1.8.9) on my Ubuntu 18.04.
    I've followed the instructions to add the Sipeed boards (I've tested on Maix-Bit).
    Then I've selected the board, and the programmer.
    Created simple program from BareMinimum example:

    int n = 0;
    void setup() {
      // put your setup code here, to run once:
        Serial.begin(115200);
        delay(2000);
        Serial.printf("==========================\r\n");
        Serial.printf("My first K210 Arduino demo\r\n");
        Serial.printf("==========================\r\n\r\n");
    }
    
    void loop() {
      // put your main code here, to run repeatedly:
      n++;
      Serial.printf("[%d] Hello world\r\n", n);
      delay(1000);
    }
    

    Flashed, and it worked as expected.

    ==========================
    My first K210 Arduino demo
    ==========================
    
    [1] Hello world
    [2] Hello world
    [3] Hello world
    [4] Hello world
    [5] Hello world
    [6] Hello world
    [7] Hello world
    [8] Hello world
    [9] Hello world
    [10] Hello world
    [11] Hello world
    [12] Hello world
    [13] Hello world
    [14] Hello world
    18:39:27.629 -> [15] Hello world
    18:39:28.622 -> [16] Hello world
    18:39:29.615 -> [17] Hello world
    18:39:30.609 -> [18] Hello world
    18:39:31.635 -> [19] Hello world
    18:39:32.629 -> [20] Hello world
    18:39:33.622 -> [21] Hello world
    18:39:34.615 -> [22] Hello world
    

    I'm not shure if anything else is needed for Maixduino board (I don't have one, but I don't think it is).
    Anyway, if it is, it is certainly not an issue with any Kendryte library...

    Blink example is also working (green LED blinks on my board).



  • Hello lobrois,

    Thanks for your reply.

    I contacted Seeed and Sipeed only after being unable to "code upload" to their respective boards. The documentation that you kindly provided was exactly what I used. I don't know which version of the Kendryte library worked in the documentation because it is not apparent from the screen shots.

    I used Arduino IDE v 1.8.9 under Ubuntu 19.04 for Maixduino and Arduino IDE v 1.8.9 under Raspbian Buster for the Grove AI HAT. Neither board could perform the standard Arduino Blink exercise. I sent detailed information including screen shots to Seeed and Sipeed. Both remarked that the issue was with the Kendryte library. Apparently, a newer Kendryte library is needed for the code to work in my two environments.

    Both Seeed and Sipeed closed my iogged issues. Seeed told me to contact Kendryte.

    Thanks again for your advice but as you may now realize I am past the stage of deployment of the toolchains. I need a newer Kendryte library to work with Arduino v 1.8.9. I don't know who can help me with that.

    Kind regards.