Flash - missing bracket Topic is solved

Report here problems in any of ChibiOS components. This forum is NOT for support.
steved
Posts: 823
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 12 times
Been thanked: 135 times

Flash - missing bracket  Topic is solved

Postby steved » Thu Jul 11, 2019 10:43 am

In os\hal\lib\complex\serial_nor\devices\macronix_mx25\hal_flash_device.h line 201 there's a missing bracket (modified file attached).

Also, the size field has been removed from type flash_descriptor_t in hal_flash.h, but is still present and set up in the device-specific code for both mx25 and n25q. (Looks as if it can just be deleted - value doesn't appear to be used).

Looking at what's changed for SPI-type flash device drivers, the current naming scheme appears to preclude having support for several different devices in a single code file, and selecting one at run-time (so that multiple device manufacturers can be supported). This capability can be useful in case of supply shortages - devices from different manufacturers are often pin-compatible.
Attachments
hal_flash_device.zip
(3.44 KiB) Downloaded 113 times

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: Flash - missing bracket

Postby Giovanni » Thu Jul 11, 2019 12:45 pm

Hi,

Thanks for the fix, I am merging.

About the size field, it is present in trunk, not present in 19.x. It has been added in latest version. Being a descriptor it is not used in code, outer layers may use it.

If you need devices selectable at runtime then you need to write a "device files" set with runtime checks on the chip IDs and all the required checks to handle command differences. Currently it is not supported but it should not require code changes in the common parts.

Giovanni

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: Flash - missing bracket

Postby Giovanni » Thu Jul 11, 2019 12:49 pm

Fixed as bug #1038.

Giovanni

steved
Posts: 823
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 12 times
Been thanked: 135 times

Re: Flash - missing bracket

Postby steved » Thu Jul 11, 2019 1:49 pm

Giovanni wrote:Hi,
If you need devices selectable at runtime then you need to write a "device files" set with runtime checks on the chip IDs and all the required checks to handle command differences. Currently it is not supported but it should not require code changes in the common parts.
Giovanni

But the device-specific files all have the same names, so there's likely to be compiler confusion if you try and include support for more than one device.
Or am I missing something here?

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: Flash - missing bracket

Postby Giovanni » Thu Jul 11, 2019 1:57 pm

You would include a single set of device files, one crafted to support multiple devices. Current device files are not designed for that.

Giovanni

steved
Posts: 823
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 12 times
Been thanked: 135 times

Re: Flash - missing bracket

Postby steved » Fri Jul 12, 2019 11:58 am

Giovanni wrote:You would include a single set of device files, one crafted to support multiple devices. Current device files are not designed for that.

Giovanni

I wondered if that was what you had in mind.
At one point you added a NULL field at the beginning of each flash descriptor with a view to supporting linked lists, and there were unique names for the interface routines of each type of flash. Could have made supporting multiple device types quite straightforward.


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 9 guests