Wipy no float and math!
Re: Wipy no float and math!
Re. the Pycom site, it's lurking at: https://www.pycom.io/solutions/py-boards/wipy/
Is there any prospect of a 'WiPy Plus', with significantly more available memory? If not, I think many folk would like some sort of float support for the current WiPy. I've posted my first attempt at a float package, in the form of one .py file, but it's incomplete and also of course doesn't help the compiler handle float constants for inputting expressions 'naturally'.
An optional MicroPython/WiPy build with float support would be nice, but given that some people would also want some 'math', and the lingering memory issue, there's a danger of a maintenance and test overhead in supporting multiple alternative builds.
Jim
Is there any prospect of a 'WiPy Plus', with significantly more available memory? If not, I think many folk would like some sort of float support for the current WiPy. I've posted my first attempt at a float package, in the form of one .py file, but it's incomplete and also of course doesn't help the compiler handle float constants for inputting expressions 'naturally'.
An optional MicroPython/WiPy build with float support would be nice, but given that some people would also want some 'math', and the lingering memory issue, there's a danger of a maintenance and test overhead in supporting multiple alternative builds.
Jim
Re: Wipy no float and math!
There just was another thread on this topic: http://forum.micropython.org/viewtopic.php?f=11&t=1014
In that thread, Danicampora definitely said, that there will be no built-in float support on WipY.
Interestingly, @jgmdavies provided a python module for performing basic float operations. Maybe that's sufficient for your needs.
In that thread, Danicampora definitely said, that there will be no built-in float support on WipY.
Interestingly, @jgmdavies provided a python module for performing basic float operations. Maybe that's sufficient for your needs.
Re: Wipy no float and math!
I am currently using various ESP6288 boards so my feelings about Wipi is probably not relevant. However I've done a lot of DSP type real time embedded work (I mean many many years of it) and wanted to add one point. Fixed point math works but floating point is at least an order of magnitude easier to implement and debug if the application has any mathematical complexity at all. Sure you don't 'need' it but you don't need a high level language either. Writing in assembler allows you to create much tighter and faster code. I did a lot of that, got pretty good at it and am glad I don't have to any more. Same with fixed point arithmetic.
I agree that you should avoid floating point where you can but fixed point can be expensive to develop. As for the concept that real apps don't need floating point...
Later!
I agree that you should avoid floating point where you can but fixed point can be expensive to develop. As for the concept that real apps don't need floating point...
Later!
Re: Wipy no float and math!
Hi all.
I'm compile mycropython for cc3200 and floating support + math.
Binary size = 194888
Ram free after loading fw -
I'm cant see any problem to compile mycropython with float/math support and why floating/math supporting disabled??? - Give user change float or no..
Link for mk files to build with floating support -
https://drive.google.com/file/d/1r2jbjc ... sp=sharing
I'm compile mycropython for cc3200 and floating support + math.
Binary size = 194888
Ram free after loading fw -
Code: Select all
MicroPython v1.12 on 2020-03-25; LaunchPad with CC3200
Login as: micro
Password:
Login succeeded!
Type "help()" for more information.
>>> r = 234/1223
>>> print (r)
0.1913328
>>> import gc
>>> gc.mem_free()
42592
>>>
Link for mk files to build with floating support -
https://drive.google.com/file/d/1r2jbjc ... sp=sharing
Re: Wipy no float and math!
I think that issue with the CC3200 is that it doesn't have your typical RAM/FLASH layout and all of the firmware gets loaded into RAM to be run.
So when you increase the size of the firmware by adding floating point support then you decrease the size of the heap by same amount as the firmware increased. If you really need floating point support and can live with the reduced heap, then that might be a favorable tradeoff, but it isn't necessarily favorable for everyone.
So when you increase the size of the firmware by adding floating point support then you decrease the size of the heap by same amount as the firmware increased. If you really need floating point support and can live with the reduced heap, then that might be a favorable tradeoff, but it isn't necessarily favorable for everyone.
Re: Wipy no float and math!
i'm only say that is possible to make fw with working floating and math.. And no need reinvent crutches for floating values.. And no official info about how compile floating support on this board - only "due to ram limitation... bla bla" - but this working and with 45kb ram - and we need change cflags, ldflags and python configs..
Re: Wipy no float and math!
If ldflags dont have this flags : -mcpu=cortex-m4 -mtune=cortex-m4 - board freezes when using float numbers - why this flags not there?
Re: Wipy no float and math!
I suspect this was just an oversight as it worked without them and previously floating point wasn't enabled. (TBH I didn't know -mtune/-mcpu were needed as linker flags -- If you have any details about what the linker does with these flags I'd be curious to know!).
To elaborate on dhyland's answer -- remember that this chip doesn't have hardware floating point (so enabling floating point is very expensive from a code size perspective) and RAM is precious (as mentioned, this chip requires code to run from RAM). So it's a pragmatic tradeoff -- most MicroPython users would rather have more heap available than have floating point enabled.
To elaborate on dhyland's answer -- remember that this chip doesn't have hardware floating point (so enabling floating point is very expensive from a code size perspective) and RAM is precious (as mentioned, this chip requires code to run from RAM). So it's a pragmatic tradeoff -- most MicroPython users would rather have more heap available than have floating point enabled.
Re: Wipy no float and math!
I'm think this cpu (cortexm4) support hard floats..
And if enable floating - fw increased with 5k - im dont think this is bigger - i'm have 45k free ram..
And with this flags code decreased with 1 or 2kb..
Im dont know what this flags did..
And if enable floating - fw increased with 5k - im dont think this is bigger - i'm have 45k free ram..
And with this flags code decreased with 1 or 2kb..
Im dont know what this flags did..
Re: Wipy no float and math!
It doesn't. It's an M4, not M4F.
Relevant quote from the ref manual:
"The ARM Cortex-M4 application processor corein the CC3200 does not include the floating point unit and memory protection unit (FPUand MPU)."