admin管理员组文章数量:1289634
I am currently working on the frdm RW612 board and have the following code that measures the temperature in the room over a few days. My script works fine but I have no way of gathering this data. The temperature code is down below. Does anyone have any ideas?
//Homework 4 Seaver Olson
#include "pin_mux.h"
#include "clock_config.h"
#include "board.h"
#include "fsl_device_registers.h"
#include "fsl_debug_console.h"
float DEMO_MeasureTemperature(void);
float DEMO_MeasureTemperature(void)
{
uint16_t tempRawValue = 0U;
if (0UL == ((SENSOR_CTRL->MISC_CTRL_REG & SENSOR_CTRL_MISC_CTRL_REG_TIMER_1_ENABLE_MASK) >>
SENSOR_CTRL_MISC_CTRL_REG_TIMER_1_ENABLE_SHIFT))
{
SENSOR_CTRL->MISC_CTRL_REG |= SENSOR_CTRL_MISC_CTRL_REG_TIMER_1_ENABLE_MASK;
}
tempRawValue = (((SENSOR_CTRL->TSEN_CTRL_1_REG_2) & SENSOR_CTRL_TSEN_CTRL_1_REG_2_TSEN_TEMP_VALUE_MASK) >>
SENSOR_CTRL_TSEN_CTRL_1_REG_2_TSEN_TEMP_VALUE_SHIFT);
return (tempRawValue * 0.480561F - 220.7074F);
}
int main(void)
{
BOARD_InitBootPins();
BOARD_InitBootClocks();
BOARD_InitDebugConsole();
// 60 x 24
for (int i = 0; i < 5760; i++) {
double temp = ((double)DEMO_MeasureTemperature());
PRINTF("%d: %.3f\n", i, temp);
for (int j = 0; j < 30; j++){
SDK_DelayAtLeastUs(1000000, CLOCK_GetCoreSysClkFreq());
}
}
return 0;
}
I've tried taking it from the serial using minicom --capturefile
. This doesn't work as I do not have a device that can be idle listening to the RW612 for that long. I would prefer if I was able to create a file on the rw612 board and take it later but anything that can retrieve the data works.
I am currently working on the frdm RW612 board and have the following code that measures the temperature in the room over a few days. My script works fine but I have no way of gathering this data. The temperature code is down below. Does anyone have any ideas?
//Homework 4 Seaver Olson
#include "pin_mux.h"
#include "clock_config.h"
#include "board.h"
#include "fsl_device_registers.h"
#include "fsl_debug_console.h"
float DEMO_MeasureTemperature(void);
float DEMO_MeasureTemperature(void)
{
uint16_t tempRawValue = 0U;
if (0UL == ((SENSOR_CTRL->MISC_CTRL_REG & SENSOR_CTRL_MISC_CTRL_REG_TIMER_1_ENABLE_MASK) >>
SENSOR_CTRL_MISC_CTRL_REG_TIMER_1_ENABLE_SHIFT))
{
SENSOR_CTRL->MISC_CTRL_REG |= SENSOR_CTRL_MISC_CTRL_REG_TIMER_1_ENABLE_MASK;
}
tempRawValue = (((SENSOR_CTRL->TSEN_CTRL_1_REG_2) & SENSOR_CTRL_TSEN_CTRL_1_REG_2_TSEN_TEMP_VALUE_MASK) >>
SENSOR_CTRL_TSEN_CTRL_1_REG_2_TSEN_TEMP_VALUE_SHIFT);
return (tempRawValue * 0.480561F - 220.7074F);
}
int main(void)
{
BOARD_InitBootPins();
BOARD_InitBootClocks();
BOARD_InitDebugConsole();
// 60 x 24
for (int i = 0; i < 5760; i++) {
double temp = ((double)DEMO_MeasureTemperature());
PRINTF("%d: %.3f\n", i, temp);
for (int j = 0; j < 30; j++){
SDK_DelayAtLeastUs(1000000, CLOCK_GetCoreSysClkFreq());
}
}
return 0;
}
I've tried taking it from the serial using minicom --capturefile
. This doesn't work as I do not have a device that can be idle listening to the RW612 for that long. I would prefer if I was able to create a file on the rw612 board and take it later but anything that can retrieve the data works.
1 Answer
Reset to default 0Use the on-board memory to collect the data.
Later when another device connects via the serial line, transfer the data on a command from that external device.
The underlying storage principle is FIFO.
本文标签: cWriting a log file to the RW612 Board and retrieving the file on another deviceStack Overflow
版权声明:本文标题:c - Writing a log file to the RW612 Board and retrieving the file on another device - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741471337a2380623.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论