Author Topic: 32F417 / 32F437 auto detect of extra 64k RAM  (Read 6912 times)

0 Members and 1 Guest are viewing this topic.

Offline AVI-crak

  • Regular Contributor
  • *
  • Posts: 141
  • Country: ru
    • Rtos
Re: 32F417 / 32F437 auto detect of extra 64k RAM
« Reply #50 on: July 06, 2023, 07:29:40 am »
I don't understand the meaning of the conversation.
Any project with a physical layer is strictly tied to a specific chip. And in some cases there is a link to the chip version of a particular model - as it has a different number of errors, and very different behavior.
The year the chip was made is important!!!
The project simply won't work on another chip.
In the case of using the IDE from ST - you must specify the version of the IDE!!!

If you failed to debug the project in two months, then it is useless to work further. Old projects with an iron level are also dying. In the case of the ST company, the one who runs the fastest wins.

In order for the project not to lose its relevance over the years, you need to get rid of the iron level, from changing software, from rigid binding to a specific chip.
Oh yes, write in pure C - it is eternal.
 

Offline peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4591
  • Country: gb
  • Doing electronics since the 1960s...
Re: 32F417 / 32F437 auto detect of extra 64k RAM
« Reply #51 on: July 06, 2023, 05:20:44 pm »
Quote
The year the chip was made is important!!!
The project simply won't work on another chip.

How?
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 28720
  • Country: nl
    • NCT Developments
Re: 32F417 / 32F437 auto detect of extra 64k RAM
« Reply #52 on: July 06, 2023, 05:34:47 pm »
Quote
The year the chip was made is important!!!
The project simply won't work on another chip.

How?
I guess AVI-crak is referring to different versions of the same chip that may or may not have fixes for silicon bugs. But since you can read the chip revision from the chip, you can determine which silicon bugs you need to work around and which are fixed. But it does take extra software.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 7531
  • Country: fi
    • My home page and email address
Re: 32F417 / 32F437 auto detect of extra 64k RAM
« Reply #53 on: July 06, 2023, 06:26:25 pm »
I guess AVI-crak is referring to different versions of the same chip that may or may not have fixes for silicon bugs. But since you can read the chip revision from the chip, you can determine which silicon bugs you need to work around and which are fixed. But it does take extra software.
Yes.  If the chip can be identified before compile time, and its bugs described via preprocessor macros, then one can save RAM/Flash use by only including the required workarounds.

This is nothing new, because standard C libraries on Linux and BSDs have had to do exactly this for decades.  It is why one configuration parameter is kernel version; features available in all later versions are assumed to be available, to limit the set.  Granted, instead of checking the kernel version, the standard C libraries use a fallback-and-flag mechanism, because unsupported syscalls return a special "Not implemented" error code.  (That is, if say openat syscall ever returns not implemented, the C library will fall back to internal path mangling and using open syscall from that point onwards.)

At the source code level, modularization helps a lot here.  You need to write the low-level hardware-access layer to abstract out the hardware differences.  I do not like using HAL for these, because their abstractions are generic; but the abstractions actually needed depend on what the software needs.  That is, the abstractions should be designed based on what the software needs, and not based on what the various hardware provides: the opposite way vendors like ST design their HALs.

Design-wise, it is a lot of work, because you have to simultaneously consider both top-down (ie. what the final software needs, to perform its functions) and bottom-up (ie. what the differences are or may be between the hardware versions this software will run on).  Also takes quite a bit of experience to know what matters in practice, and so on.

Note that I am not claiming that doing it this way makes any business sense; I am only describing what is technically possible and done in other similar circumstances.
« Last Edit: July 06, 2023, 06:28:23 pm by Nominal Animal »
 

Offline peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4591
  • Country: gb
  • Doing electronics since the 1960s...
Re: 32F417 / 32F437 auto detect of extra 64k RAM
« Reply #54 on: July 06, 2023, 06:28:09 pm »
I would be amazed if any of my code relies on some CPU bugs having been fixed.

How long has a 32F417 been out? I bought my main stock in 2019, before covid came and made them unobtainable.

Edit: year 2010 approx.
« Last Edit: July 06, 2023, 06:33:47 pm by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 7531
  • Country: fi
    • My home page and email address
Re: 32F417 / 32F437 auto detect of extra 64k RAM
« Reply #55 on: July 06, 2023, 06:30:02 pm »
Have you checked the errata ST provides?
 

Offline peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4591
  • Country: gb
  • Doing electronics since the 1960s...
Re: 32F417 / 32F437 auto detect of extra 64k RAM
« Reply #56 on: July 06, 2023, 06:38:33 pm »
Yes, at various times.

Practically the whole lot describes never-fixed stuff e.g.



The yellow is never-fixed (for good reasons, obviously) and only the few shown had been fixed, like the CPU ID (fixed for good reasons, obviously!).

I would conclude that if my software, mostly either written by me or a colleague since about 2019, or based on ex ST Cube MX "HAL" code from c. 2019 (not much left of it now), works correctly, that should be OK.

Most of the stuff in the errata is not even used in my code (but some would be "interesting" if it was, like the I2S stuff) but I spotted this



and I am buggered if I know where this code is. I see FIFO related stuff in a number of places. But the entire USB code is run as an ISR so it would be a question of priorities. But maybe not since the corruption happens only if writing to the other USB regs, ints from other things should not affect it. Anyway, it does work.
 
If ST started fixing that long list, it would break a lot of software.
« Last Edit: July 06, 2023, 07:24:02 pm by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 
The following users thanked this post: Nominal Animal

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 28720
  • Country: nl
    • NCT Developments
Re: 32F417 / 32F437 auto detect of extra 64k RAM
« Reply #57 on: July 06, 2023, 07:31:26 pm »
I guess AVI-crak is referring to different versions of the same chip that may or may not have fixes for silicon bugs. But since you can read the chip revision from the chip, you can determine which silicon bugs you need to work around and which are fixed. But it does take extra software.
Yes.  If the chip can be identified before compile time, and its bugs described via preprocessor macros, then one can save RAM/Flash use by only including the required workarounds.
No, these workarounds are typically enabled / disabled at runtime to make the software more compatible with all possible hardware out there. This doesn't increase size of the software significantly because the workarounds are only a few lines of code.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4591
  • Country: gb
  • Doing electronics since the 1960s...
Re: 32F417 / 32F437 auto detect of extra 64k RAM
« Reply #58 on: July 06, 2023, 07:43:10 pm »
From the 5 pages of unfixed errata, and only a few items which were fixed, and all of those few were fixed after version 1, there is a clear policy by ST to not fix any of the stuff which is there today.

I also think, practically, that with a chip which came out in say 2010, if say UART 3 was dud, somebody would have noticed and reported it.

The ST website confirms the 32F417 with a 10 year min production life commencing 2013.
https://www.st.com/content/st_com/en/about/quality-and-reliability/product-longevity.html#10-year-longevity
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 7531
  • Country: fi
    • My home page and email address
Re: 32F417 / 32F437 auto detect of extra 64k RAM
« Reply #59 on: July 06, 2023, 09:07:43 pm »
I guess AVI-crak is referring to different versions of the same chip that may or may not have fixes for silicon bugs. But since you can read the chip revision from the chip, you can determine which silicon bugs you need to work around and which are fixed. But it does take extra software.
Yes.  If the chip can be identified before compile time, and its bugs described via preprocessor macros, then one can save RAM/Flash use by only including the required workarounds.
No, these workarounds are typically enabled / disabled at runtime to make the software more compatible with all possible hardware out there. This doesn't increase size of the software significantly because the workarounds are only a few lines of code.
That is what is most commonly done, yes (except workarounds like the stack pointer being loaded from incorrect address if an interrupt happens during the data phase using LDR SP, [Rn], #imm, with workaround being to load the value to a temporary register and from there to stack pointer, tend to be always enabled, since they are harmless on hardware that does not have the bug).

But, if the exact variant is known at compile time, they can be implemented directly, without any runtime checks or patching.  This kind of code adapting to hardware is not new, and can be also done at compile time, not only runtime, was my point.

there is a clear policy by ST to not fix any of the stuff which is there today.
Based on the errata, it definitely looks that way.

The OTG_FS and OTG_HS bugs mean there may be some USB HID devices that won't work with STM32F417 as the host.  (The only low-speed USB devices I've ever seen are some old custom HID devices, like those used in old mini numpads and old bar code readers.)

The OTG_FS_DCFG bug means when read, the DAD and PFIVL bits (4-12) may be incorrect.  The workaround is to use a 32-bit RAM variable for it, initializing it to 0x0220'0000 (it's bootup initialization value), and do the operations on the RAM variable and just copy the value to usbx->DCFG.  I don't see such a workaround in STM32CubeF4/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c at Github, though.

I didn't look at the other errata.
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 16278
  • Country: fr
Re: 32F417 / 32F437 auto detect of extra 64k RAM
« Reply #60 on: July 06, 2023, 09:16:08 pm »
The ST website confirms the 32F417 with a 10 year min production life commencing 2013.
https://www.st.com/content/st_com/en/about/quality-and-reliability/product-longevity.html#10-year-longevity

So you're close to EOL now?

I would definitely consider switching to something newer.

As to unfixed silicon bugs, that's annoying but rather common. Silicon bugs are expensive to fix and fixes lead to revisions of the same IC with different behavior, which the customer would have to deal with at run time one way or another, which can be worse than having a workaround for a known bug and sticking to it without ever fixing the bug.
 

Offline peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4591
  • Country: gb
  • Doing electronics since the 1960s...
Re: 32F417 / 32F437 auto detect of extra 64k RAM
« Reply #61 on: July 06, 2023, 09:42:42 pm »
The 10 year guarantee starts on Jan 2023.

And they have been renewing the 10 year period every year for the last few years.

Based on what I've seen over the last 30-40 years I reckon ST will run these chips for a total of 25-30 years, same as Hitachi have been doing. So maybe another 15 years.

Another positive factor is that the chinese have picked the 407 (417 without hardware crypto) as one of the main chips to rip off (legally or not). They might know something ;) I can use the 407 with just one #define change in one .h file, and it works with no practical performance loss (the aes256 code in MbedTLS runs at almost 1MB/sec). The 407 is a hugely popular chip.

Re the USB thing, my product is a USB client only. The OTG mode was not implemented, not least because a) it was not needed b) it leads to unrealistic customer expectations as regards supported clients and c) available power for clients would be very limited.
« Last Edit: July 07, 2023, 07:55:20 am by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf