Skip to content

STM32: OS and Struct support#2167

Closed
hierophect wants to merge 19 commits into
adafruit:masterfrom
hierophect:stm32-os
Closed

STM32: OS and Struct support#2167
hierophect wants to merge 19 commits into
adafruit:masterfrom
hierophect:stm32-os

Conversation

@hierophect
Copy link
Copy Markdown
Collaborator

@hierophect hierophect commented Sep 19, 2019

This PR adds basic OS and Struct support to assist with libraries. Uses #2151

@ladyada
Copy link
Copy Markdown
Member

ladyada commented Sep 19, 2019

woopz i think this got mixed with another i2c PR? if its easier we can wait till i test the other open PR so it can be merged

@hierophect
Copy link
Copy Markdown
Collaborator Author

@ladyada It's a direct branch of my existing PR, since I need that code to test I2C libraries

@ladyada
Copy link
Copy Markdown
Member

ladyada commented Sep 19, 2019

ahh ok

@hierophect
Copy link
Copy Markdown
Collaborator Author

hierophect commented Sep 19, 2019

Binary (tested, works for me)
firmware.bin.zip

@ladyada
Copy link
Copy Markdown
Member

ladyada commented Sep 19, 2019

tested, this is good!

>>> import os
>>> os.stat("foo")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OSError: [Errno 2] No such file/directory
>>> os.stat("boot_out.txt")
(32768, 0, 0, 0, 0, 0, 108, 1480810702, 1480810702, 1480810702)
>>> dir(os)
['__class__', '__name__', 'chdir', 'getcwd', 'listdir', 'mkdir', 'remove', 'rename', 'rmdir', 'sep', 'stat', 'statvfs', 'sync', 'uname', 'unlink', 'urandom']
>>> os.mkdir("test")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OSError: [Errno 30] Read-only filesystem
>>> os.uname()
(sysname='stm32f4', nodename='stm32f4', release='5.0.0', version='5.0.0-alpha.4-53-g18c5be883-dirty on 2019-09-19', machine='STM32F412G_DISCO with STM32F412xGS')
>>> os.urandom()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: function takes 1 positional arguments but 0 were given
>>> os.urandom(1)
b'\x04'
>>> os.urandom(8)
b'\x04\x04\x04\x04\x04\x04\x04\x04'
>>> os.listdir()
['.fseventsd', '.metadata_never_index', '.Trashes', 'lib', 'boot_out.txt', 'System Volume Information']
>>> 

ladyada
ladyada previously approved these changes Sep 19, 2019
@hierophect
Copy link
Copy Markdown
Collaborator Author

Let's make sure we merge the original first!

@hierophect hierophect added the stm label Sep 19, 2019
@ladyada
Copy link
Copy Markdown
Member

ladyada commented Sep 19, 2019

ok ill test that one now

@hierophect hierophect changed the title STM32: OS support STM32: OS and Struct support Sep 20, 2019
@hierophect
Copy link
Copy Markdown
Collaborator Author

Closes #2169

@tannewt
Copy link
Copy Markdown
Member

tannewt commented Sep 20, 2019

I'd suggest rebasing the os and struct commits onto master for this PR. That way this PR doesn't depend on the other and we can review and merge in parallel. Let me know if you need help with git. It's got a steep learning curve.

@hierophect
Copy link
Copy Markdown
Collaborator Author

hierophect commented Sep 20, 2019

@tannewt I'd be happy to rebase, but since there are no modules I'm aware of that can even make use of OS and Struct without I2C being available, it'd make this hard to test independently, which is why I had it as an extension of that branch. I can probably fix your comments on I2C pretty quickly, do you still want me to move it?

@tannewt
Copy link
Copy Markdown
Member

tannewt commented Sep 20, 2019

You can test os and struct yourself with a test script like what @ladyada did above. Please do move it and make any PRs you do in the future independent so we can have multiple review cycles going.

@hierophect
Copy link
Copy Markdown
Collaborator Author

Ok, I thought the rebase was going to be simple but it's turning out to be a huge pain, so I'm just going to go ahead and delete/recreate this.

@hierophect hierophect closed this Sep 20, 2019
@hierophect hierophect deleted the stm32-os branch September 20, 2019 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants