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.

Share Improve this question edited Feb 19 at 22:09 Seaver Olson asked Feb 19 at 20:21 Seaver OlsonSeaver Olson 4783 silver badges17 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Use 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