micropython-Chinese-Community / MicroPython_firmware

MicroPython firmware for Various development board can run micropython.
80 stars 35 forks source link

SenSorTile Firmware_v1.8.7-7 not working #1

Open sanyaade-iot opened 6 years ago

sanyaade-iot commented 6 years ago

Hi Shaoziyang,

Many thank for putting the firmware on github. I try the firmaware with STM32-Link Utility but the SensorTile did not work.

I extracted the SENSORTILE_board_support.zip into micropython/ports/stm32/boards. rename the folder to "STM32L476JGY6DISC". I try to build the SENSORTILE_board_support but I got error message below: sanyaade@ns1:~/Compilers/micropyhton/master/ports/stm32$ make BOARD=STM32L476JGY6DISC Makefile:5: *** Invalid BOARD specified. Stop. sanyaade@ns1:~/Compilers/micropyhton/master/ports/stm32$`

I notice that board_init.c was missing from the SENSORTILE_board_support folder. Where can I download the file?

Hear from you soon!

God blesses!!!

Best regards, Sanyaade

sanyaade-iot commented 6 years ago

@shaoziyang :

Ok! I got it compile using the SENSORTILE_board_support jusr unzip it as SENSORTILE and did not change it form mpconfigbaord.h

Also I have to comment out #define MICROPY_HW_I2C_BAUDRATE_DEFAULT 100000 and

define MICROPY_HW_I2C_BAUDRATE_MAX 100000 as they are giving redefined errors with the generated ones inside qstr.i.last . I will wrap them under ifdef later on when I get it working on the SensorTile board.

I upload with STM-Link Utility to SensorTile board but nothing happen I try the SensorTile App but cannot see SensorTile or connect to it.

Hear from you soon!

God blesses!!!

Best regards, Sanyaade

shaoziyang commented 6 years ago

Thank you for give the solution. It maybe causing by mpy source upgrade. I will try it later.

Best regards, Shaoziyang

sanyaade-iot commented 6 years ago

@shaoziyang : Oh! I will try mpy v1.8.7 to see if it will work.

God blesses!!!

Best regards, Sanyaade

sanyaade-iot commented 6 years ago

@shaoziyang

I just try out mpy v1.8.7. This compiles without errors ( no errors) Alos try out v1.9.3, gave errors so errors are due to source upgrade.

I flash the hex from v1.8.7 but still notting happens. I am using SensorTile cradle expansion.

I need to know how I can use it usb connector for serial REPL with micropython

Hear from you soon!

God blesses!!!

Best regards, Sanyaade

shaoziyang commented 6 years ago

I using microUSB connect SensorTile with SensorTile expansion Cradle board, and using a ST-Link from Nucleo board to download HEX firmware, it works fine.

Can you see PYBFlash disk when plug USB cable?

sanyaade-iot commented 6 years ago

@shaoziyang

Good day to you.

No I see no PYBFlash disk. No not all. I saw only image

image

I am on Windows 7 do you program on Windows 7 or Linux? Please state.

Is it possible to send me a screenshot of your setup and how you wired up your SensorTile and Nucleo board? cheers!

After uploading the firmware, nothing happens. I try to use WebREPL but not successful.

Hear from you soon!

God blesses!!!

Best regards, Sanyaade

shaoziyang commented 6 years ago

My own sensortile has been become part of my SensorTilePocketWatch project, so I can't show how to connect it.

But you may find how to program sensortile from a nucleo board in ST document: UM2101: Getting started with the STEVAL-STLKT01V1 SensorTile integrated development platform.

I using Win7 x64 when I develop it.

sanyaade-iot commented 6 years ago

@shaoziyang

Many thanks for your reply. I will try again to see how I get around the issues.

I think it is the bootloader problems but I need to investigate it more....

I am working with your board support and also learning how to create modules for MicroPython as well.

I will let you know how I get on.

God blesses!!!

Best regards, Sanyaade

sanyaade-iot commented 6 years ago

@shaoziyang

Its me again! Good day to you over there. Got the MicroPython working with SensorTile. But I have to change my debugger/programmer which I bought from China on eBay

20171126_220123

I have tried v1.8.7 and v1.9.3 whcih are both working. I will tried v2.0 later when I am free. See below: image

Debugger connection to SensorTile: see image below: image

I need to do some demos or see if I could extend it with dmazella code ; https://github.com/dmazzella/uble Also learn more about the GPIO mapping of SensorTile.

Hear from you soon!

God blesses!!!

Best regards, Sanyaade

shaoziyang commented 6 years ago

Hi,

Using Nucleo board's ST-Link/V2 maybe more better and easy.

nucleo

And do not forgot to remove jumper in nucleo board before link SensorTile.

01

--

Best regard!

Shao ziyang Shaoziyang@126.com

2017年12月1日

At 2017-12-01 04:51:42, "sanyaade-iot" notifications@github.com wrote:

@shaoziyang

Its me again! Good day to you over there. Got the MicroPython working with SensorTile. But I have to change my debugger/programmer which I bought from China on eBay

I have tried v1.8.7 and v1.9.3 whcih are both working. I will tried v2.0 later when I am free. See below:

Debugger connection to SensorTile: see image below:

I need to do some demos or see if I could extend it with dmazella code ; https://github.com/dmazzella/uble Also learn more about the GPIO mapping of SensorTile.

Hear from you soon!

God blesses!!!

Best regards, Sanyaade

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

sanyaade-iot commented 6 years ago

@shaoziyang

With Nucleo board, I was unable to use Putty Terminal & REPL that is why I bought this on eBay from China. I have also order the ST-Link v2.

I will try the Nucleo again and see if I could get the REPL prompt with Putty again.

Do you have any test/demo code?

Many thanks!

God blesses!!!

Best regards, Sanyaade

shaoziyang commented 6 years ago

You may see my another project to get some sensor drive for SensorTile:

https://github.com/shaoziyang/SensorTilePocketWatch

You need import st.py first, then you may use the LPS22HB, LSM6DSM and LSM303AGR.

https://github.com/shaoziyang/SensorTilePocketWatch/blob/master/src/st.py

sanyaade-iot commented 6 years ago

@shaoziyang

Many thanks for your tips and support. I got it working with those code from SensorTilePocketWatch.

I was able to import st.py and run --> e.g. st.MX(), st.AC(), and many others. Many thanks!

I am now merging dmazzella's uble library. I got it compile into SensorTile, I was able to run some of its code. But some like SPI code are causing problems due to different board and pin mappings. I have not contact him yet since I think it is MCU problem specific so I will try more time. First I need to see how SensorTile SPI baud rate is implmented or just disable it for now but it is good to get resolve.

I think dmazzella's design is based around PyBoard and has a custom expansion board but other part of his code are working. I will upload them to GitHub soon and send you a link.

Hear from you soon!

Many thanks!

God blesses!!!

Best regards, Sanyaade

shaoziyang commented 6 years ago

micropython only support 4-wire SPI, but SensorTile using 3-wire SPI, so it can't work if you using SensorTile's SPI wire.

but micropython support software SPI mode, using any pin as SPI's sck/mosi/miso, it maybe work in dmazzella's uble library.

sanyaade-iot commented 6 years ago

Hi @shaoziyang

Yes! You are right but we could port/transplant from other module and transplant into MicroPython. See:

https://github.com/tomstokes/python-spi https://github.com/doceme/py-spidev http://microbit-micropython.readthedocs.io/en/latest/spi.html (looks like 3-wire)? https://cdn-learn.adafruit.com/downloads/pdf/micropython-hardware-spi-devices.pdf http://comedicles.com/category/chapters/micropython-esp8266-stm-arm/ (A work for 3-wire)

for some 3-wire work around. AdaFruit CircuitPython has 3-wire for their micropython fork. py-spidev is a C python interface single file module

Micro-bit fork has 3-Wire extension Esp8266-stm-arm also documents a 3-Wire for Micropython

What do you think?

Hear from you soon!

God blesses!!!

Best regards, Sanyaade

shaoziyang commented 6 years ago

Hi, porting module is wonderful, but it takes a lot of time and experience.

I hope there is a high quality code repository for official micropython.