Jump to content

-KP-

Members
  • Content Count

    8
  • Joined

  • Last visited

  1. -KP-

    Flash write time

    Jep, that might be it, thanks for clearing that! However I don't know to execute code from SRAM, so I'll just work with an external SRAM. But thanks anyway.
  2. -KP-

    Flash write time

    So I did, writing 32 words (full buffer) takes 1 ms! As I expected this doesn't help a thing. Help!
  3. -KP-

    Flash write time

    Will try, but how will writing 32 words be faster then 2?
  4. -KP-

    Flash write time

    I'm not using the whole buffer, but I've got it set up so that 2 words (or 4 samples) are programmed at a time (see first post); The problem I'm having is that, even with the adjusted one I posted in my previous post, FlashProgram() still takes >50µs. In this time TMR interrupt gets skipped and so I still have to wait for it to finish...
  5. -KP-

    Flash write time

    As you can see, I have just commented out the while loops waiting for the flash being programmed. long FlashProgram(unsigned long *pulData, unsigned long ulAddress, unsigned long ulCount) { // // Check the arguments. // ASSERT(!(ulAddress & 3)); ASSERT(!(ulCount & 3)); // // Clear the flash access and error interrupts. // HWREG(FLASH_FCMISC) = (FLASH_FCMISC_AMISC | FLASH_FCMISC_VOLTMISC | FLASH_FCMISC_INVDMISC | FLASH_FCMISC_PROGMISC); // // See if this device has a write buffer. // if(HWREG(SYSCTL_NVMSTAT) & SYSCTL_NVMSTAT_FWB) { // // Loop over the words to be programmed. // while(ulCount) { // // Set the address of this block of words. // HWREG(FLASH_FMA) = ulAddress & ~(0x7f); // // Loop over the words in this 32-word block. // while(((ulAddress & 0x7c) || (HWREG(FLASH_FWBVAL) == 0)) && (ulCount != 0)) { // // Write this word into the write buffer. // HWREG(FLASH_FWBN + (ulAddress & 0x7c)) = *pulData++; ulAddress += 4; ulCount -= 4; } // // Program the contents of the write buffer into flash. // HWREG(FLASH_FMC2) = FLASH_FMC2_WRKEY | FLASH_FMC2_WRBUF; // // Wait until the write buffer has been programmed. // /* while(HWREG(FLASH_FMC2) & FLASH_FMC2_WRBUF) { } */ } } else { // // Loop over the words to be programmed. // while(ulCount) { // // Program the next word. // HWREG(FLASH_FMA) = ulAddress; HWREG(FLASH_FMD) = *pulData; HWREG(FLASH_FMC) = FLASH_FMC_WRKEY | FLASH_FMC_WRITE; // // Wait until the word has been programmed. // /* while(HWREG(FLASH_FMC) & FLASH_FMC_WRITE) { } */ // // Increment to the next word. // pulData++; ulAddress += 4; ulCount -= 4; } } // // Return an error if an access violation occurred. // if(HWREG(FLASH_FCRIS) & (FLASH_FCRIS_ARIS | FLASH_FCRIS_VOLTRIS | FLASH_FCRIS_INVDRIS | FLASH_FCRIS_PROGRIS)) { return(-1); } // // Success. // return(0); }
  6. -KP-

    Flash write time

    Ok, But is it possible to 'do' something, continue with the program, while flash is being written, or do you just have to wait for it?
  7. -KP-

    Flash write time

    Hi, I'm using the Stellaris Launchpad as part of sequencer/sampler musical instrument that I'm working on right now. I use the internal flash to record and store a couple of short 1-sec clips of audio, sampled at 21kHz - 12 bit. With the FlashProgram() function of the peripheral driver library, I store two words or four samples consecutively, so: record 4 samples - write to flash - record 4 samples - write to flash - etc. The recording happens on a timer interrupt, however the program skips an interrupt every 4 times, exactly when FlashProgram() is doing its thing. So I dove in the FlashProgram() code and adjusted the part where it is waiting, or polling, until the write is complete. This way, I thought, my program could continue running while the flash took its time to get written, 50µs or so. But it still continues skipping while it's writing to flash. Any suggestions to solve this? Or is it just impossible to 'do' anything while flash is being written?
  8. -KP-

    powering from VBUS while using debug usb

    Yes, I can confirm, that is possible.
×