2018-09-05 02:01 PM
I am currently using MDK essential version which allows me to use the following: all the mdk tools and software pack related to device and CMSIS but not middle ware.
I am doing a project in which i will have to store the values of motor vibration from accelerometer and have to do a digital signal processing on the stored values. I intially purchased a sd card and break out board and realized that , As a MDK essential version member i cannot use a file system!! In order to use a file system I will have to pay around 3000$ and upgrade my license to MDK essential plus.
Apart from storing the values through file system, what are the other ways in which i can store the values via serial communication ??? which eliminates the use of file system. are there any other ways????
I am not sure how much space i would need but i will have to take atleast 5k samples in one second.
2018-09-05 02:42 PM
> As a MDK essential version member i cannot use a file system!!
It's annoying, but not a show stopper.
You can write to a SD card without a file system.
If you definitely want a filesystem - Just use the free fatfs component from ST.
CubeMX supports it. Some people even got it working with SD storage.
-- pa
2018-09-05 04:01 PM
You can use SDIO and FATFS without using any Keil middleware.
2018-09-05 04:04 PM
Perhaps describe what STM32 specifically you are using, and what interfaces you have on the board. Serial can stream at high rates. You could use some packet protocol and write a PC side application to sink the data and write to log files.
2018-09-05 05:03 PM
VisualStudio and VisualGDB is only $150... seems very stable to me...
did you see the AT25DN256 ? flash 256Kb (32K x 8) 34c each...
void writeFlashBytes(uint32_t address, int length, char*ptr){
enableFlashWrites();
HAL_GPIO_WritePin(AT25DN256_nSS_GPIO_Port, AT25DN256_nSS_Pin, GPIO_PIN_RESET);
transfer(BytePageProgram);
char addressByte2 = (address >> 16) & 0xff;
char addressByte1 = (address >> 8) & 0xff;
char addressByte0 = (address) & 0xff;
char dummyByte = 0;
transfer(addressByte2);
transfer(addressByte1);
transfer(addressByte0);
while(length--)
{
transfer(*ptr++);
}
// this is needed to be sure the last byte is out of the pin before we drop the nSS
while (!(hspi1.Instance->SR & SPI_FLAG_TXE)) ;
while ((hspi1.Instance->SR & SPI_FLAG_BSY)) ;
//putc1(RxSPI);
HAL_GPIO_WritePin(AT25DN256_nSS_GPIO_Port, AT25DN256_nSS_Pin, GPIO_PIN_SET);
disableFlashWrites();
}
void transfer(unsigned short data) { // send only //as fast as possible
char RxSPI;
while (!(hspi1.Instance->SR & SPI_FLAG_TXE)) ;
*((__IO uint8_t *)&hspi1.Instance->DR) = data;
RxSPI = hspi1.Instance->DR;// + readSPI_SR; // read Rx byte and discard, only clearing the buffer
}
char transfer_receive(unsigned short data) { // send and receive byte
char RxSPI;
while(!(hspi1.Instance->SR & SPI_FLAG_TXE)) // make sure the last byte is gone.
;
while ((hspi1.Instance->SR & SPI_FLAG_RXNE))
RxSPI = hspi1.Instance->DR; //empty and dump all fifo bytes
*((__IO uint8_t *)&hspi1.Instance->DR) = data; // force the SPI to transceive 8 bit
while(!(hspi1.Instance->SR & SPI_FLAG_TXE)) // wait to transmitter double buffer to shift into transmitter
;
while ((hspi1.Instance->SR & SPI_FLAG_BSY)) ; // wait for data to shift out of the processor pins
while((hspi1.Instance->SR & SPI_FLAG_RXNE)) // load all the bytes received, only keep the last one
RxSPI = hspi1.Instance->DR; // we only want the last byte
return RxSPI;
}