- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I want to Erase CFM0,but it seems like flash didn't receive my command. Why?
Below are code:
CFM1 : CFM
port map(
clock => ssClk,
reset_n => ssRst,
avmm_data_addr => slv17avmm_data_addr,
avmm_data_read => slavmm_data_read,
avmm_data_writedata => slv32avmm_data_writedata,
avmm_data_write => slavmm_data_write,
avmm_data_readdata => slv32avmm_data_readdata,
avmm_data_waitrequest => slavmm_data_waitrequest,
avmm_data_readdatavalid => slavmm_data_readdatavalid,
avmm_data_burstcount => B"01",
avmm_csr_addr => slavmm_csr_addr,
avmm_csr_read => slavmm_csr_read,
avmm_csr_writedata => slv32avmm_csr_writedata,
avmm_csr_write => slavmm_csr_write,
avmm_csr_readdata => slv32avmm_csr_readdata
);
FlashErase : process( ssClk )
begin
if rising_edge( ssClk ) then
slv32MSG_ID_Old <= slv32MSG_ID;
case stFlashEraseState is
when ST_ERASE_IDLE =>
slEraseOK <= '0';
if slv32MSG_ID = X"00001000" and slv32MSG_ID_Old /= X"00001000" then
stFlashEraseState <= ST_ERASE_UNPROTECT;
slavmm_csr_write <= '1';
slavmm_csr_addr <= '1';
slv32avmm_csr_writedata <= X"F7FFFFFF";
end if;
when ST_ERASE_UNPROTECT =>
stFlashEraseState <= ST_ERASE_START;
slavmm_csr_write <= '1';
slavmm_csr_addr <= '1';
slv32avmm_csr_writedata <= X"F7FFFFFF";
when ST_ERASE_START =>
stFlashEraseState <= ST_ERASE_WAIT;
slavmm_csr_write <= '1';
slavmm_csr_addr <= '1';
slv32avmm_csr_writedata <= X"F7DFFFFF";
when ST_ERASE_WAIT =>
stFlashEraseState <= ST_ERASE_WAIT;
slavmm_csr_write <= '0';
slavmm_csr_read <= '1';
slavmm_csr_addr <= '0';
if slv32avmm_csr_readdata(1 downto 0) = B"00" and slv32avmm_csr_readdata(3) = '1' then
stFlashEraseState <= ST_ERASE_IDLE;
slavmm_csr_read <= '0';
slavmm_csr_write <= '1';
slavmm_csr_addr <= '1';
slv32avmm_csr_writedata <= X"FFFFFFFF";
slEraseOK <= '1';
end if;
when others =>
null;
end case;
end if;
end process FlashErase;
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
- May I know how do you connect the clk to the On Chip Flash IP?
- Is it from internal Oscillator or clk pin?
- What is the clk frequency used?
- Could you read the status register (CSR_ADDR = 0x0) after you disable the write protection and after you execute sector erased?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks a lot!
I have solved this and the problem is caused by wrong reset signal.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am glad to hear that the issue has been resolved and is due to the reset signal not routed correctly.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page