- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm trying to get the alt_write_flash and alt_erase_flash functions working.
When I try to open the FLASH device specified in my system.h using the alt_flash_open_dev function it always returns 0 (device not opened). From what I can tell the LLIST that is supposed to have the registered flash components in it is empty. How do I correctly register my flash device (a standard AMD CFI flash)? Do I have to write the low level read and write routines or are these already done somewhere in the HAL libraries? Is there a complete example somewhere that shows the process of registering a FLASH device, creating the low level code (sending command words to erase/write flash, etc) and using it with the alt_flash functions? Thanks, NathanLink Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Nathan,
CFI is a standard protocol to comunicate with flash devices. So if your flash is CFI compatible, you have to write no driver for it: in fact using the HAL implements the driver to use the function "alt_flash_open_dev","alt_erase_flash_block", "alt_write_flash_block" and so on. <div class='quotetop'>QUOTE </div> --- Quote Start --- From what I can tell the LLIST that is supposed to have the registered flash components in it is empty[/b] --- Quote End --- What do u mean?- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
<div class='quotetop'>QUOTE </div>
--- Quote Start --- I'm trying to get the alt_write_flash and alt_erase_flash functions working. When I try to open the FLASH device specified in my system.h using the alt_flash_open_dev function it always returns 0 (device not opened). From what I can tell the LLIST that is supposed to have the registered flash components in it is empty. How do I correctly register my flash device (a standard AMD CFI flash)? Do I have to write the low level read and write routines or are these already done somewhere in the HAL libraries? Is there a complete example somewhere that shows the process of registering a FLASH device, creating the low level code (sending command words to erase/write flash, etc) and using it with the alt_flash functions? Thanks, Nathan[/b] --- Quote End --- My guess here is that the function alt_flash_cfi_init is failing, there are many reasons this could happen, but mainly it tends to be broken hardware, or a non CFI compliant flash chip. Your best way forward is to stick a breakpoint in this function step through and find where the problem lies. If this function succeeds it adds the flash part to the list of flash devices. There is an example in the Memory Test example. You should not need to modify the low level code to send commands, this should work with CFI flashes.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do I have to all the alt_flash_cfi_init function somewhere or is this called automatically?
This function is what registers the flash device right? Nathan- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The init function is called from alt_sys_init.c - which is automatically generated to match the hardware described in your system.ptf file.
You don't have to call it, and yes it is the function which registers the flash.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the help. It turns out my biggest issue was trying to run FLASH simulations with the "modelsim only, no hardware support" check box on. It turns out this allows flash reading but not writing or initializing.
Nathan
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page