From: asimlink on
Dear Friends,

i am using Altium Designer for fpga and embedded project on digilent
spartan3E-500 board.
I have created an FPGA project in Altium using open bus document containing
three device:
1. TSK3000A
2. WB_PRTIO_1 (for leds)
3. WB_UART_V2_1
Added a top level schematic sheet. Added constraint file to the project
containing correct fpga pin designators. Configured the TSK3000 memory size
as 16K. The fpga project gets synthesized and bit stream is generated
without any problem.
Next i created an embedded project and made it child of the TSK3000 cpu.
Configured Aplication Memory as 0-8K as ROM and 8k-16K as ram.
Adjusted the Stack size to 512. Heap size " " (nothing not even 0).
Created main.c and software platform document. My software platform
document contains:
hardware rappers:
1. WB_PRTIO_1
2. WB_UART_V2_1
and driver files:
1. DRV_PRTIO_1
2. DRV_UART_V2_1

following is my main.c:
-------------------------------------------------
#include <stdio.h>
#include <stdint.h>
#include <drv_uart8.h>
#include <drv_ioport.h>
#include "hardware.h"
#include "devices.h"

uart8_t* uart;
ioport_t* ioport;

void main(void)
{
int value=0;
uart = uart8_open(DRV_UART8_1); //uart8_t* uart8_open(int id);
uart8_set_baudrate(uart,19200);
ioport = ioport_open(DRV_IOPORT_1); //ioport_t* ioport_open(const int id);

value = uart8_write(uart,"helloworld\n", 20);
ioport_set_value(ioport, WB_PRTIO_1, 0xaa);
ioport_set_value(ioport, WB_PRTIO_1, 0x55);

while (1)
{
//int uart8_putchar(uart8_t *restrict drv, int val);
//uart8_putchar(uart, uart8_getchar(uart)); //int uart8_getchar(uart8_t
*restrict drv);
uart8_putchar(uart, 'U');

}

}
---------------------------------
I have attached pc com port with my boards serial port and running hyper
terminal on the other end of the serial cable.
Now the problem is:
I can write to leds without any problem but i never see prints from
uart8_write(); function.

I have following questions which I hope someone will come up with answers:

1. How to compute value of stack requirement?
2. How to compute value for heap?
3. What might be wrong with my design that i don't see message on the
serial port?
4. How can i configure my embedded design to re-direct printf output to
UART?

Regards.



---------------------------------------
Posted through http://www.FPGARelated.com
From: shoonya on
>Dear Friends,
>
>i am using Altium Designer for fpga and embedded project on digilent
>spartan3E-500 board.
>I have created an FPGA project in Altium using open bus document
containing
>three device:
>1. TSK3000A
>2. WB_PRTIO_1 (for leds)
>3. WB_UART_V2_1
>Added a top level schematic sheet. Added constraint file to the project
>containing correct fpga pin designators. Configured the TSK3000 memory
size
>as 16K. The fpga project gets synthesized and bit stream is generated
>without any problem.
>Next i created an embedded project and made it child of the TSK3000 cpu.
>Configured Aplication Memory as 0-8K as ROM and 8k-16K as ram.
>Adjusted the Stack size to 512. Heap size " " (nothing not even 0).
>Created main.c and software platform document. My software platform
>document contains:
>hardware rappers:
>1. WB_PRTIO_1
>2. WB_UART_V2_1
>and driver files:
>1. DRV_PRTIO_1
>2. DRV_UART_V2_1
>
>following is my main.c:
>-------------------------------------------------
>#include <stdio.h>
>#include <stdint.h>
>#include <drv_uart8.h>
>#include <drv_ioport.h>
>#include "hardware.h"
>#include "devices.h"
>
>uart8_t* uart;
>ioport_t* ioport;
>
>void main(void)
>{
>int value=0;
>uart = uart8_open(DRV_UART8_1); //uart8_t* uart8_open(int id);
>uart8_set_baudrate(uart,19200);
>ioport = ioport_open(DRV_IOPORT_1); //ioport_t* ioport_open(const int
id);
>
>value = uart8_write(uart,"helloworld\n", 20);
>ioport_set_value(ioport, WB_PRTIO_1, 0xaa);
>ioport_set_value(ioport, WB_PRTIO_1, 0x55);
>
>while (1)
>{
>//int uart8_putchar(uart8_t *restrict drv, int val);
>//uart8_putchar(uart, uart8_getchar(uart)); //int uart8_getchar(uart8_t
>*restrict drv);
>uart8_putchar(uart, 'U');
>
>}
>
>}
>---------------------------------
>I have attached pc com port with my boards serial port and running hyper
>terminal on the other end of the serial cable.
>Now the problem is:
>I can write to leds without any problem but i never see prints from
>uart8_write(); function.
>
>I have following questions which I hope someone will come up with
answers:
>
>1. How to compute value of stack requirement?
>2. How to compute value for heap?
>3. What might be wrong with my design that i don't see message on the
>serial port?
>4. How can i configure my embedded design to re-direct printf output to
>UART?
>
>Regards.
>
>
>
>---------------------------------------
>Posted through http://www.FPGARelated.com
>

First of all your check if are opening the correct uart -
>and driver files:
>1. DRV_PRTIO_1
>2. DRV_UART_V2_1 <<<<<<<
>
>uart = uart8_open(DRV_UART8_1); //uart8_t* uart8_open(int id);

they are different.

To redirect your printf to UART, go to software platform file.
GO to Serial IO options - there is option to select your stdout and stdin
device - set to your uart device name.

the printf will be redirected to the uart now.

For your stack requirement - the .map file gives you a preliminary stack
analysis


Regards
Manish



---------------------------------------
Posted through http://www.FPGARelated.com
 | 
Pages: 1
Prev: Simulation error
Next: DLC9G problem