rotemse

Forum Replies Created

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • in reply to: MBED SD Card File system not compiling on VisualGDB #13341
    rotemse
    Participant

    Still struggling with SD card to interface with VisualGDB.

    I imported an MBED library called  SDBlockDevice

    And now I get the error that my MBED version in VisualGDB is not high enough.

     

    #ifdef MBED_MAJOR_VERSION
    #if (MBED_VERSION < MBED_ENCODE_VERSION(5,6,1))
    #error “Incompatible mbed-os version detected! Required 5.5.4 and above”
    #endif
    #else

    What Can I do?

    How do I check my version?

    How Do I upgrade my version in the project?

    • This reply was modified 6 years, 4 months ago by rotemse.
    in reply to: MBED SD Card File system not compiling on VisualGDB #13286
    rotemse
    Participant

    One more update:

    if I put the line: SDFileSystem sd(PD_4, PD_3, PD_1, PA_1, “sd”);

    inside main, I get this run time error and the program stops execution on this line:

     

    Couldn’t create sd in FATFileSystem::FATFileSystem

     

    in reply to: MBED SD Card File system not compiling on VisualGDB #13285
    rotemse
    Participant

    I got this to compile, however, the SD card still doesn’t work.

    the same project from MBED online compiler doesn’t work on VisualGDB.

    the “mkdir” command does not invoke the function from fatfilesystem.h., instead it points to stdio.h

    What can be done?

    the line FILE *fp = fopen(“/sd/123.txt”, “r”);

    gives me the error “cannot open file for write”

    and program stops execution.

    it’s like the compiler doesn’t see the line:

    SDFileSystem sd(PD_4, PD_3, PD_1, PA_1, “sd”);

    in the declaration.

    If I comment it out, it behaves the same (as if I never wrote it)

    what can be done?

    in reply to: DISCO L476 USART 3 not working #12776
    rotemse
    Participant

    Hi

    I tried the example from the URL, but I still can’t receive any serial data. Transmitting serial data works well.

    I am using interrupts.

    Here is my code.

    #ifdef __cplusplus
     extern "C"
     #endif
     void SysTick_Handler(void)
     {
     HAL_IncTick();
     HAL_SYSTICK_IRQHandler();
     }
    
    static UART_HandleTypeDef s_UARTHandle = UART_HandleTypeDef();
    
    void initRS485()
     {
     HAL_Init();
    
    __USART3_CLK_ENABLE();
     __GPIOC_CLK_ENABLE();
    
    GPIO_InitTypeDef GPIO_InitStructure;
    
    GPIO_InitStructure.Pin = GPIO_PIN_10;
     GPIO_InitStructure.Mode = GPIO_MODE_AF_PP;
     GPIO_InitStructure.Alternate = GPIO_AF7_USART3;
     GPIO_InitStructure.Speed = GPIO_SPEED_HIGH;
     GPIO_InitStructure.Pull = GPIO_NOPULL;
     HAL_GPIO_Init(GPIOC, &GPIO_InitStructure);
    
    GPIO_InitStructure.Pin = GPIO_PIN_11;
     GPIO_InitStructure.Mode = GPIO_MODE_AF_OD;
     HAL_GPIO_Init(GPIOC, &GPIO_InitStructure);
    
    s_UARTHandle.Instance        = USART3;
     s_UARTHandle.Init.BaudRate   = 115200;
     s_UARTHandle.Init.WordLength = UART_WORDLENGTH_8B;
     s_UARTHandle.Init.StopBits   = UART_STOPBITS_1;
     s_UARTHandle.Init.Parity     = UART_PARITY_NONE;
     s_UARTHandle.Init.HwFlowCtl  = UART_HWCONTROL_NONE;
     s_UARTHandle.Init.Mode       = UART_MODE_TX_RX;
    
    if (HAL_UART_Init(&s_UARTHandle) != HAL_OK)
     pc.printf("error\r\n");
     HAL_NVIC_SetPriority(USART3_IRQn, 0, 0);
     HAL_NVIC_EnableIRQ(USART3_IRQn);
    
    }
    
    void USART3_IRQHandler()
     {
     HAL_UART_IRQHandler(&s_UARTHandle);
     }
     void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
     {
     if (huart->Instance == USART3)
     {
     // Your buffer is full with your data process it here or set a flag
     pc.printf("%d",buffer3);
     }
     }
    
    
    
    
    int main(void)
     {
    
    initRS485();
     for (;;)
     {
     HAL_UART_Receive_IT(&s_UARTHandle, (uint8_t *)buffer3, sizeof(buffer3));
    
    //some coder here
    
    }
    
    }
    • This reply was modified 6 years, 6 months ago by support. Reason: formatting
    in reply to: DISCO L476 USART 3 not working #12740
    rotemse
    Participant

    all the other UARTS are working well with the same MBED code running in VisualGDB.

    I didn’t change anything…

     

Viewing 5 posts - 1 through 5 (of 5 total)