cancel
Showing results for 
Search instead for 
Did you mean: 

Good afternoon, I have written two versions of the time output test programs to the console for STM32MP157D. Both programs work no more than 2 hours, then the system restarts. What did I do wrong? Sincerely, Alexander.

Vlaty.1
Senior

Good afternoon, I have written two versions of the time output test programs to the console for STM32MP157D. Both programs work no more than 2 hours, then the system restarts. What did I do wrong?

Sincerely, Alexander. 

//////////////////////////////////////////////////////////////////////////////

def time_show():

  await asyncio.sleep(10)

  os.system("date > time_info.txt")

  f = open('time_info.txt','r')

  read_data = f.read()

  f.close()

  os.system("rm time_info.txt")

  print(read_data[11],read_data[12],read_data[13],read_data[14],read_data[15])

if __name__ == "__main__":

  loop = asyncio.get_event_loop()

  loop.run_until_complete(time_show())

  datsa = 10

  for i in range(data):

    time_show()

  os.system("python3 tablo")

//////////////////////////////////////////////////////////////////////////

import asyncio

import datetime

import os

import subprocess

import time

def display_date(end_time, loop)

  print(datetime.datetime.now())

  if (loop.time() + 1.0) < end_time:

    time.sleep(60)

    loop.call_later(1, display_date, end_time, loop)

  else:

    os.system("python3 time_date1")

loop = asyncio.get_event_loop()

end_time = loop.time() + 5.0

loop.call_soon(display_date, end_time, loop)

loop.run_forever()

loop.close()

2 REPLIES 2
Eldam
Senior

Hello,

Maybe you could try your code on another platform?

like raspberry pi?

Your code doesn't seems to use STM32MP1 OldOneSecretFunctions,

maybe I'm wrong!

Vlaty.1
Senior

Good afternoon. I couldn't find any examples of working with date and time on MP157. This was the reason for improvisation. Sincerely, Alexander.