Open bmitov opened 4 years ago
I have not been using it for almost a year, so i forgot most of it, but afaik its using SPI, and esp32 should be (at least it was) programmed with fw that allows communication. More info you may find here: https://en.bbs.sipeed.com/
Thank you @chegewara . What Chip Select is used to talk to the ESP32 from the K210 ? Do you happen to have some example code, or link to tutorial or something?
This is python code, but i hpe it will help you: https://github.com/chegewara/sipeed-maixduino-test-apps/blob/master/platformIO/MaixPy/esp32-wifi.py
You can also flash esp32 with your own FW. Here is very simple test that is using UART to communicate k210 with esp32. esp32 is flashed with custom fw: https://github.com/chegewara/sipeed-maixduino-test-apps/tree/master/platformIO/freertos/uart-to-esp32
btw, esp32 is pre-programmed with NINA firmware
@chegewara I know that I can flash the ESP32 :-) I can even program it with Visuino . It is already supported. I did not want to override any factory code however. My question was what is on it factory ready? I wanted to test it before I override the code ;-)
In essence if the ESP32 comes pre programmed with AT type firmware, then I can add the AT support on the K210 side in Visuino as a WiFi module. Otherwise, I will just leave it as Serial and SPI channels for the ESP32 and just allow boths sides to be programmed individually.
Like i mentioned in other topic, its NINA. https://github.com/sipeed/Maixduino_esp32_fimware
@chegewara Thank you so much! :-) It is programmed when it arrives right :-) I will test shortly.
If you want to use UART to send AT commands to the ESP32 you have to make the following changes. Download the Espressif AT firmware and change this file, then re-build and re-flash firmware:
components/customized_partitions/raw_data/factory_param/factory_param_data.csv
-PLATFORM_ESP32,WROOM-32,,0xfcfc,2,1,78,1,1,13,CN,115200,17,16,15,14,-1,-1
+PLATFORM_ESP32,WROOM-32,,0xfcfc,2,1,78,0,1,13,CN,115200,1,3,-1,-1,-1,-1
Then in the Arduino library, changes the pin mapping for pins 6 & 7 to k210 pins 6 & 7
Arduino15/packages/Maixduino/hardware/k210/0.3.11/variants/sipeed_maixduino/pins_arduino.h
static const uint8_t _maixduino_pin_map[17] = {4, 5, 21, 22, 23, 24, **6, 7,** 14, 13, 12, 11, 10, 3, 31, 30, 16};
Using these changes I can now use the internal UART between the k210 and ESP32 for AT commands. You can also still use the ESP32 directly.
Use this wifi esp library for arduino: WifiEspAT
Waiting for connection to WiFi
..
Connected to WiFi network.
Starting connection to server...
connected to server
HTTP/1.1 200 OK
Server: nginx/1.4.2
Date: Tue, 12 Jan 2021 08:50:17 GMT
Content-Type: text/plain
Content-Length: 2263
Last-Modified: Wed, 02 Oct 2013 13:46:47 GMT
Connection: close
Vary: Accept-Encoding
ETag: "524c23c7-8d7"
Accept-Ranges: bytes
`:;;;,` .:;;:.
.;;;;;;;;;;;` :;;;;;;;;;;: TM
`;;;;;;;;;;;;;;;` :;;;;;;;;;;;;;;;
:;;;;;;;;;;;;;;;;;; `;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;; .;;;;;;;;;;;;;;;;;;;;
;;;;;;;;:` `;;;;;;;;; ,;;;;;;;;.` .;;;;;;;;
.;;;;;;, :;;;;;;; .;;;;;;; ;;;;;;;
;;;;;; ;;;;;;; ;;;;;;, ;;;;;;.
,;;;;; ;;;;;;.;;;;;;` ;;;;;;
;;;;;. ;;;;;;;;;;;` ``` ;;;;;`
;;;;; ;;;;;;;;;, ;;; .;;;;;
`;;;;: `;;;;;;;; ;;; ;;;;;
,;;;;` `,,,,,,,, ;;;;;;; .,,;;;,,, ;;;;;
:;;;;` .;;;;;;;; ;;;;;, :;;;;;;;; ;;;;;
:;;;;` .;;;;;;;; `;;;;;; :;;;;;;;; ;;;;;
.;;;;. ;;;;;;;. ;;; ;;;;;
;;;;; ;;;;;;;;; ;;; ;;;;;
;;;;; .;;;;;;;;;; ;;; ;;;;;,
;;;;;; `;;;;;;;;;;;; ;;;;;
`;;;;;, .;;;;;; ;;;;;;; ;;;;;;
;;;;;;: :;;;;;;. ;;;;;;; ;;;;;;
;;;;;;;` .;;;;;;;, ;;;;;;;; ;;;;;;;:
;;;;;;;;;:,:;;;;;;;;;: ;;;;;;;;;;:,;;;;;;;;;;
`;;;;;;;;;;;;;;;;;;;. ;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;; :;;;;;;;;;;;;;;;;:
,;;;;;;;;;;;;;, ;;;;;;;;;;;;;;
.;;;;;;;;;` ,;;;;;;;;:
;;; ;;;;;` ;;;;: .;; ;; ,;;;;;, ;;. `;, ;;;;
;;; ;;:;;; ;;;;;; .;; ;; ,;;;;;: ;;; `;, ;;;:;;
,;:; ;; ;; ;; ;; .;; ;; ,;, ;;;,`;, ;; ;;
;; ;: ;; ;; ;; ;; .;; ;; ,;, ;;;;`;, ;; ;;.
;: ;; ;;;;;: ;; ;; .;; ;; ,;, ;;`;;;, ;; ;;`
,;;;;; ;;`;; ;; ;; .;; ;; ,;, ;; ;;;, ;; ;;
;; ,;, ;; .;; ;;;;;: ;;;;;: ,;;;;;: ;; ;;, ;;;;;;
;; ;; ;; ;;` ;;;;. `;;;: ,;;;;;, ;; ;;, ;;;;
disconnecting from server.
@chegewara I know that I can flash the ESP32 :-) I can even program it with Visuino . It is already supported. I did not want to override any factory code however. My question was what is on it factory ready? I wanted to test it before I override the code ;-)
I get the following information from a python script:
[esp32_spi] use soft spi 1.4.0
I bought mine in the first quarter of 2021.
There is new firmware 1.4.1 by Sipeed, https://dl.sipeed.com/shareURL/MAIX/factory_firmware/esp32 but could not flash it.
From the NINA source code, the ESP32 communicates through SPI and not a serial port with AT commands. I have managed to communicate it with the fork of WiFiEsp (branch esp32_spi) by @scpcom and using its fork of Maixduino.
Hello guys I want program to establish communication between k210 and esp32 using uart in platform io
I have not been able to find much information on this :-( .