#1-The 1-wire debugging protocol for RISC-V MCU CH32V003

Поділитися
Вставка
  • Опубліковано 19 лют 2023
  • This video will briefly introduce the following two questions.
    What is the 1-wire debugging RISC-V protocol?
    &How does WCH-LINKE work?
    &How does WCH make RISC-V MCU 10 cent ?
    #riscv #32-bit #debugging #1-wire protocol #10 cent riscv
    WCH official store:
    www.aliexpress.com/store/1102...
    The 1-wire debugging protocol documentation could be checked here:
    github.com/openwch
    TIPS:
    You can contact Patrick for both technical and sales questions via Twitter(Patrick_RISCV) or UA-cam comments secton. I will answer your questions one by one :)
    Which WCH chips are you interested in? What technical information do you need Patrick to provide? Tell me in the comments section.
    I will select 60 people from the comments section, and then give away 60 cash coupons worth $5.

КОМЕНТАРІ • 104

  • @rvmaking
    @rvmaking  Рік тому +4

    Just released the code of 1-wire protocol for CH32V003 based on CH32F103 (arm M3). FYI
    github.com/openwch/ch32v003/tree/main/CH32V003_1Line_Base_on_CH32F103

  • @jarekcdiy1989
    @jarekcdiy1989 Рік тому

    Thanks Patrick. Any technical information is valuable.

  • @manutronics
    @manutronics Рік тому +1

    Thank you so much for this work onto a Debug way to RISC-V. It is a huge effort!

    • @rvmaking
      @rvmaking  Рік тому

      we are also communicating with the RISC-V International Foundation, suggesting that 1-wire could be used as a standard debugging solution for low-cost MCU

  • @petermuller608
    @petermuller608 Рік тому

    I love your openes!

  • @MariusHeier1
    @MariusHeier1 Рік тому +1

    Great to see a video about this. :)

    • @rvmaking
      @rvmaking  Рік тому +1

      we're talking about filming the next technical video.

  • @mariobv947
    @mariobv947 Рік тому +4

    Thank you very much for all the effort that you are doing. It would be quite interesting if you create an international section at the WCH board in english language for widening customers support and enlarge the community.

    • @rvmaking
      @rvmaking  Рік тому +5

      Thanks!Documentation translation and international technical support are the things I have been working hard on and I will spend more energy on this very meaningful thing this year.

  • @oderlandoribeiro7168
    @oderlandoribeiro7168 Рік тому +3

    Hello, Patrick. The CH32V003 microcontroller is very interesting and inexpensive, and this is very good. He's giving what to talk about and has caught the attention of a lot of people. Here in Brazil it is not available, but I intend to acquire the development kit soon and make the transition of some projects to use this incredible microcontroller. I'm excited to do this and I believe it will be a great opportunity. I currently use STM32, but possibly I will start using CH32V microcontrollers !

    • @rvmaking
      @rvmaking  Рік тому

      Hi, thanks for your positive comments. Looking forward to your CH32 trip :)

  • @icesoop
    @icesoop Рік тому +1

    Been looking into these for small projects, this will surely help

    • @rvmaking
      @rvmaking  Рік тому

      whenever you encounter any problems during the development process, you can leave me messages or DM me

  • @CliffordHeath
    @CliffordHeath Рік тому +6

    A gdbserver implementing this in one of your USB CPUs would make a dongle that supports a really slick development environment, better perhaps than Espressif has - especially if you publish peripheral device driver source too

    • @rvmaking
      @rvmaking  Рік тому +3

      It's so good to see you here, my friend. you are right. The CH32V203 would be more suitable with USB and the peripheral drivers are all open source and have provided a complete API application interface😀

  • @sonyxp942
    @sonyxp942 Рік тому +2

    Hoping that this product succeeds. Best of luck brother.

  • @treideme
    @treideme Рік тому +1

    Thanks Patrick!

  • @Aleza0000
    @Aleza0000 Рік тому +1

    Nice

  • @rvmaking
    @rvmaking  Рік тому +5

    The documentation of 1-wire protocol can be downloaded here: github.com/openwch/ch32v003

    •  Рік тому +1

      I will make the usb adapter by myself. Thank you.

    • @rvmaking
      @rvmaking  Рік тому

      @ OK

    •  Рік тому +1

      @@rvmaking how to erase the chip when the 1-wire is disabled in the code?

    • @rvmaking
      @rvmaking  Рік тому +2

      @ It's a good question!
      if that happens, you can send a pause command immediately after power-on for about 15ms. If the chip can enter the pause state, the code that closes the debugging interface will not be executed. So in the paused state, just erase the flash from the debugging interface

    • @rvmaking
      @rvmaking  Рік тому +4

      @ It's a good question!
      if that happens, you can send a pause command immediately after power-on for about 15ms. If the chip can enter the pause state, the code that closes the debugging interface will not be executed. So in the paused state, just erase the flash from the debugging interface

  • @shguro90
    @shguro90 Рік тому +1

    In any case my part of the week

  • @QuentinFu
    @QuentinFu Рік тому +1

    pretty good

  • @elektrowolle
    @elektrowolle Рік тому +2

    I‘ll try to use it on my CH32v003 Eval Board.

    • @rvmaking
      @rvmaking  Рік тому

      Did you make your own CH32V003 Eval Board?

    • @elektrowolle
      @elektrowolle Рік тому +1

      No, just started with the CH32V003F4P6-EVT-R0 in my holiday.

  • @arnonuehm8942
    @arnonuehm8942 Рік тому +1

    I came across the CH32V003 by accident and immediately ordered the hardware kit for both it and the CH32V307. I'm excited to find out how they fare against STM parts.

    • @rvmaking
      @rvmaking  Рік тому +1

      Ahh, If you have any questions for the CH32 chips, please reach out to me directly

  •  Рік тому +1

    Great

    • @tranhoangthanhduy
      @tranhoangthanhduy Рік тому +1

      không ngờ cũng gặp anh Cường trên này :))

    •  Рік тому

      @@tranhoangthanhduy :)

  • @4Fixerdave
    @4Fixerdave Рік тому +1

    I picked up a WCH_LinkE programmer, dev board, and 150 of these MCUs. Running the MounRiver IDE under Windows, programs as expected (other than needing the WC_Link Utility to wipe the 8-pin ones to reprogram) and (with help) figured out that I need to use the RX line on the programmer to get Terminal output to the IDE. So, working well and pretty happy so far.
    But, I found the "one wire debug" manual you showed in this video and it lists all kinds of commands that go way beyond programming. Is that functionality something we can use from the IDE? If so, any chance on a tutorial for that? If not, is there some other interface that uses it, or are there any plans for it?

  • @rvmaking
    @rvmaking  Рік тому +4

    Congratulations to those friends who received replies!if you happen to want to buy some WCH chips, please DM me on Twitter (patrick_riscv), and I will send you a $5 cash coupon. It can be understood that you can get 50 pieces of CH32V003F4P6 for free. Coupon giveaway is still going on~

  • @macosm7818
    @macosm7818 Рік тому +1

    Well done Patrick, your MCU's are really good and the biggest advantage for new customers is a nice free IDE.

    • @rvmaking
      @rvmaking  Рік тому +1

      thanks for your support. Your satisfaction is our motivation to continue to work hard~

  • @ExpectMichael
    @ExpectMichael Рік тому +2

    Thanks Patrick. Any chance of the two wire protocol for the other ch32v's being released?

    • @rvmaking
      @rvmaking  Рік тому +2

      This is obviously the thing I try to do next :)

  • @tiyo-dd5il
    @tiyo-dd5il Рік тому +3

    I have tried this chip. The 1-wire firmware download is very fast.

    • @rvmaking
      @rvmaking  Рік тому +2

      hope you can share your measured speed and experience😀

  • @lwg6605
    @lwg6605 Рік тому +2

    Hello Patrick, great video! I want to use the CH32V003 bootloader to program in circuit via the UART. Is bootloader documentation available?

    • @rvmaking
      @rvmaking  Рік тому +2

      Because the V003 hasnt boot pin, so we wrote an IAP program to enter BOOT mode. These program can be checked in CH32V003EVT which named USART-IAP. First download the IAP code to chip via 1-wire, thus you can use WCH-LinkUtility to program the chip via the UART now. I have arranged to write the documentation about how to use the IAP and bootloader for CH32V003.

    • @lwg6605
      @lwg6605 Рік тому +2

      @@rvmaking Thank you. I look forward to seeing the documentation.

    • @rvmaking
      @rvmaking  Рік тому +2

      @@lwg6605 Here is the documentation for you. github.com/openwch/ch32v003/blob/main/CH32V003_IAP_Use_Introduction.pdf

    • @lwg6605
      @lwg6605 Рік тому +2

      @@rvmaking thank you!

  • @koray8820
    @koray8820 Рік тому +1

    I would really like to try it

    • @rvmaking
      @rvmaking  Рік тому

      looking forward to your work:)

  • @FozleaRabbi
    @FozleaRabbi Рік тому +1

    Add some Application Note, add support VS Code, PDF user manual for MR Studio, host wch website somewhere where global user can browse faster, make a version of WCH-Link offline programming capable. I think CH32Vxxx has huge potential market. Best wishes for WCH & Patric

    • @rvmaking
      @rvmaking  Рік тому

      Thanks for your sincere suggestion. Some of the above work has been done and some are in the process. In short, I will absorb any good suggestions from everyone to make WCH products better😀

    • @dekus80
      @dekus80 Рік тому

      I don't use crooked eclipse MounRiver, but Clion not tied to any manufacturer, I take another newer gcc (v12), I don't use their copied from stm32 SPL, but registers. I create own register header file back to stm32 names to not to tie code and to copy/paste from/to stm32 projects, I made programmer by myself. So I don't use anything from wch to play with ch32v (bought at local store to explore), ahahahaha.

  • @futaris
    @futaris Рік тому +2

    Wonder if a RP2040 could do this protocol.

    • @rvmaking
      @rvmaking  Рік тому +2

      It can run this protocol

    • @davidwillmore
      @davidwillmore Рік тому

      There are STM32F042, ESP32S2, and rp2040 programmer/debuggers already. Possibly a CH552 and STM32F103 version soon as well.

  • @akoze
    @akoze Рік тому +3

    my order is on the way. do you think there will be arduino support in future ?

    • @rvmaking
      @rvmaking  Рік тому +2

      The following work plan is to port the Zephyr on CH32V307 first.

    • @old_Taki
      @old_Taki Рік тому +2

      ​@@rvmakingarduino support would make a plethora of libraries available 👍😉

    • @rvmaking
      @rvmaking  Рік тому +3

      @@old_Taki This is a big project, so we need to implement it step by step

    • @old_Taki
      @old_Taki Рік тому +1

      @@rvmaking quite so!

  • @tusnat760
    @tusnat760 Рік тому

    Could you share a debugging protocol document for CH582M EVT ?

  • @FranciscoGonzalez-gl7fg
    @FranciscoGonzalez-gl7fg Рік тому +1

    I’d like to try it out… I am working with other low cost MCUs but not Arm ISA

    • @rvmaking
      @rvmaking  Рік тому

      8-bit MCU?

    • @FranciscoGonzalez-gl7fg
      @FranciscoGonzalez-gl7fg Рік тому

      @@rvmaking yes, but width and clock speed do not make much of a difference simple devices that just need i2c, uart, dow etc.

  • @ukaszpuka1583
    @ukaszpuka1583 Рік тому +1

    Is the same protocol implemented in CH32V307 (and e.g.CH32V208 ) ?

    • @rvmaking
      @rvmaking  Рік тому +1

      Not quite the same. 1-wire protocol was designed mainly to save the number of IOs of the MCU without greatly reducing the debugging speed

  • @HansPuijk123
    @HansPuijk123 Рік тому

    With USB makes a great tool in the current assortment of cpu's

  • @marciomontenegro4016
    @marciomontenegro4016 Рік тому +2

    Hello Patrick, MounRiver IDE is ok for me. By my clients need something simpler like WCHDUINO

    • @rvmaking
      @rvmaking  Рік тому

      CHduino is under the porting. and It will be released soon.

    • @davidwillmore
      @davidwillmore Рік тому

      Have you seen ch32v003fun? It is very lightweight.

  • @gerrycave
    @gerrycave Рік тому +2

    Getting my shipment of SOP-8 CH32V003J4M6 today... a bit concerned of not having an NRESET pin, how do I enter programming mode on them?
    Will be using them without an external Xtal... if that makes any sense. Still designing an initial test board for them.

    • @rvmaking
      @rvmaking  Рік тому

      you can use WCH-LinkE to let the chip enter programming mode. or using the IAP code in the SDK and ISP tool would be another way but it's a little complicated because the chip does not reserve a boot pin

    • @tiyo-dd5il
      @tiyo-dd5il Рік тому

      I have programmed my bare chip with 3-wire connection between WCH-LinkE and chip this way
      SWDIO → PD1
      GND → GND
      3.3V → Vcc
      I assume it should work on CH32V003J4M6 .

    • @rvmaking
      @rvmaking  Рік тому

      @@tiyo-dd5il yeah, It should work

  • @jbrian8618
    @jbrian8618 Рік тому +1

    Hi Patrick,
    I've have the official WCH LinkE programmer and demo board and am using the MounRiver software. Initially I cold program modify and reprogram the board BUT suddenly started giving a "Board chip status error" .
    So thinking the chip (CH32v003F4P6) had been bricked I carefully replaced it which allowed me to program the new one but only once.
    I then tried connecting just vcc, gnd and swdio to an 8 pin CH32V003J4M6 again it programmed immediately ONCE and once only I repeated with two further 8 pin chips with the same result in each case the program written to the device worked but would not allow further programming . I have tried on both Linux and MS Windows.
    Do you have any clues as to what is happening???
    P.S. I have ordered a new WCH LinkE but it will take a while to arrive..

    • @rvmaking
      @rvmaking  Рік тому +1

      Hey, I think the problem should be the I/O alternate issue of PD1. Here is the method to rework the debug function. step 1, Power the CH32v003 with the voltage of WCH-LINK, step 2, Keep the WCH-Link's 1-wire connected to PD1,step 2, Update the MRS IDE to the latest version(v1.84), then click the button step by step: Flash-->Configuration-->Clear Code Flash--> choose the "By Power off"-->Apply , step 3, CH32V003 comes alive again.

    • @jbrian8618
      @jbrian8618 Рік тому

      @@rvmaking you he MAN :-) . Upgraded my MS Windows version and it works great , oddly it doesn't remember the configuration settings between build/burn sessions but I'm sure I can chase that .. Just need to sort my Linux version next..
      Thank you so much 🙂

    • @davidwillmore
      @davidwillmore Рік тому

      If you want to, you can also use the minichlink program from the ch32v003fun project. It has an 'unbrick' function just like the mounriver studio does, but is a lot more lightweight.

    • @rvmaking
      @rvmaking  Рік тому +1

      @@davidwillmore Hi could you post the ch32v003fun project link :)

    • @jbrian8618
      @jbrian8618 Рік тому

      @@davidwillmore Hi yep I found that and it works well allowing me to "play" with some raw CH32 riscv assembler code :thanks again :-)

  • @HaritTrivedi7
    @HaritTrivedi7 Рік тому

    The Audio Is just now audible on any speaker. please fix it.

    • @rvmaking
      @rvmaking  Рік тому

      Can you describe it more clearly? :)

    • @HaritTrivedi7
      @HaritTrivedi7 Рік тому

      ​@@rvmaking sure, I think you are little far away from the microphone. So while watching the video over a phone speaker phone or laptop speakers..audio is not audible, hence I had to look for my headphones to watch the video.

  •  Рік тому

    There is no initial sequence in the document.

    • @rvmaking
      @rvmaking  Рік тому

      The first step is to reset the debug interface bus and the reset hold time should be at least 256*125ns. The second step is to enable the debug interface output register, set SHDWCFGR=0x5AA50400, CFGR=OX5AA50400, judge whether CPBR is equal to 0x00010403, if so, the debug mode is available.

    •  Рік тому

      @@rvmaking I do like that, but it doesnt work. Read without any reply.

    • @rvmaking
      @rvmaking  Рік тому +1

      @ can you read the value of register CPBR and be sure to equal to 0x00010403?

    •  Рік тому

      @@rvmaking can not. There is no response signal.

    •  Рік тому

      @@rvmaking now it works. I understand now.

  • @cryptearth
    @cryptearth Рік тому

    haven't watched the video in its full length - but isn't "1-wire" misleading as you always need at least 2 wires for a complete circuit?