Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected Restarts #27

Open
myamigo opened this issue Feb 5, 2022 · 0 comments
Open

Unexpected Restarts #27

myamigo opened this issue Feb 5, 2022 · 0 comments

Comments

@myamigo
Copy link

myamigo commented Feb 5, 2022

Hi Boris,

I'm considering a port of our standalone SDK project to a uPy supported version and think yours may provide a base for that.

I'm on WIndows with wsl2 so I built the F/W using the steps on your WIKI with no trouble. I installed the firmware (MicroPython.kfpkg) using the kflash gui tool (V1.6) and connected with my terminal prog. I followed some of the steps in the wiki and then I ran a simple loop/print test. After a few seconds the device restarted. Refer to the following output...

M (370013) [K210_MAIN]: Default flash configuration set

RISC-V Kendryte ---------------------------------------------
 _    _   _____   _   ______    ___   ___   ______   _     _
( )  / ) (___  ) ( ) (  __  )  (   \ /   ) (  __  ) ( )   ( )
| |_/ /   ___| | | | | |  | |  | |\ \ /| | | |__| |  \ \_/ /
|  _ )   ( ____) | | | |  | |**| | \_/ | | |  ____)   \   /
| | \ \  | |___  | | | |__| |  | |     | | | |         | |
(_)  \_) (_____) (_) (______)  (_)     (_) (_)         (_)
-------------------------------------------------------------
MicroPython-FreeRTOS by LoBo v1.12.02
-------------------------------------

MicroPython 1.12.02 (68a6b75-dirty) built on 2022-02-05; Sipeed_board with Kendryte-K210
Type "help()" for more information.
>>> import machine, _thread
>>> _thread.list()

Total system run time: 69.065 s, number of tasks running: 
MicroPython threads:
-------------------------------------------------------------------------------------------------------------------
ID(handle) Proc             Name      State  Stack  Used MaxUsed PyStack   Used    Type Priority Run time (s)   (%)
-------------------------------------------------------------------------------------------------------------------
2150748512    0       MainThread*   running  32768  1424    2840    4096     64    MAIN        8        0.237  0.34

FreeRTOS tasks running:
-------------------------------------------------------------------------------
ID(handle) Proc             Name     State MinStack Priority Run time (s)   (%)
-------------------------------------------------------------------------------
2150748512    0     main_mp_task   Running    29928       15        0.237  0.34
2149323944    0             IDLE     Ready     7416        0       68.462 99.13
2149326056    1             IDLE     Ready     7416        0        0.000  0.00
2150713248    0    hal_tick_task   Blocked     7432        1        0.001  0.00
-------------------------------------------------------------------------------
FreeRTOS heap: Size: 3141632, Free: 731544, Min free: 664208
  System heap: Free: 744448

>>> machine.state()
 PLL0: 988000000, PLL1: 806000000,  PLL2:  45066666, SPI3clk: 494000000
 APB0: 247000000, APB1: 247000000,  ACLK: 494000000,    HCLK: 494000000
  CPU: 494000000,  KPU: 403000000
SRAM0: 494000000 (ACLK/1)
SRAM1: 494000000 (ACLK/1)

Current SPI Flash speed: 35285714 Hz
RAM buffer of 4096 bytes at 0x80300000
OTA not used
Heaps: FreeRTOS=3068 KB (714 KB free), MPy=2300 KB, other=727 KB
>>> machine.mpy_config()

MicroPython configuration:
--------------------------
   MPy version code: 011201
  Two MPy instances: False
       PyStack used: True
Available heap size: 2300 KB
      MPy heap size: 2300 KB
       PyStack size: 4096 B
     MPy stack size: 32768 B
      CPU frequency: 400 MHz
      REPL baudrate: 115200 bd
      Boot menu pin: 0
  Default log level: 2 (LOG_WARN)
     Use log colors: 1 (True)
         VM divisor: 32 bytecodes
(False, True, 2355200, 2355200, 0, 4096, 32768, 400000000, 115200, 0, 2, True, 32)
>>>
>>> import time
>>> i=0
>>> current_time=time.ticks_ms()
>>> while(True):
...     i+=1
...     if time.ticks_ms()>current_time+500:
...         current_time=time.ticks_ms()
...         print("i = {}".format(i))
...
...
...
i = 1
i = 87910
i = 175811
i = 263633
i = 351473
i = 439325
i = 527201
i = 615064
i = 702950
i = 790815
i = 878692

M (370937) [K210_MAIN]: Default flash configuration set

RISC-V Kendryte ---------------------------------------------
 _    _   _____   _   ______    ___   ___   ______   _     _
( )  / ) (___  ) ( ) (  __  )  (   \ /   ) (  __  ) ( )   ( )
| |_/ /   ___| | | | | |  | |  | |\ \ /| | | |__| |  \ \_/ /
|  _ )   ( ____) | | | |  | |**| | \_/ | | |  ____)   \   /
| | \ \  | |___  | | | |__| |  | |     | | | |         | |
(_)  \_) (_____) (_) (______)  (_)     (_) (_)         (_)
-------------------------------------------------------------
MicroPython-FreeRTOS by LoBo v1.12.02
-------------------------------------

MicroPython 1.12.02 (68a6b75-dirty) built on 2022-02-05; Sipeed_board with Kendryte-K210
Type "help()" for more information.
>>> 

This happens every time but the time (i value) varies slightly each time. I simpler version of the test seems to run indefintely without issue...

M (370942) [K210_MAIN]: Default flash configuration set

RISC-V Kendryte ---------------------------------------------
 _    _   _____   _   ______    ___   ___   ______   _     _
( )  / ) (___  ) ( ) (  __  )  (   \ /   ) (  __  ) ( )   ( )
| |_/ /   ___| | | | | |  | |  | |\ \ /| | | |__| |  \ \_/ /
|  _ )   ( ____) | | | |  | |**| | \_/ | | |  ____)   \   /
| | \ \  | |___  | | | |__| |  | |     | | | |         | |
(_)  \_) (_____) (_) (______)  (_)     (_) (_)         (_)
-------------------------------------------------------------
MicroPython-FreeRTOS by LoBo v1.12.02
-------------------------------------

MicroPython 1.12.02 (68a6b75-dirty) built on 2022-02-05; Sipeed_board with Kendryte-K210
Type "help()" for more information.
>>> import time
>>> while(True):
...     time.sleep(1)
...     print(".",end="")
...
...
...
.............................................................................................................................................................................................................................

Can you confirm this as an issue?

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant