I have received the ADZS-SC573-EZLITE. Where do I start? I need tutorials, examples, information.

I have previously worked with the STM32 MCU.

Now I have received an ADZS-SC573-EZLITE to play with for our new project. I have installed the CrossCore Embedded Studio and managed to create a project.

Why must I select a Silicon revision when creating the project?

The project I managed to create outputs a text on the UART0 (through the FTDI). I can see in my terminal that it receives the correct text.

I thought I could use printf() to output to the debug console. Why doesn't the printf() work?

And I think I call adi_pwr_Init() the correct way or do I need to call it before enabling the other cores?. But how do I know if the DSP will setup it's internal clocking to highest speed, or is there only one speed (STM32 could be configured at different speeds)?

What is the CGU device number when calling the adi_pwr_Init()?

And where can I find tutorials or more examples? I just managed to get this to work, I really need to get more information.

For my real project I need to know how to use all cores and communication between them, how/where do I learn that? 

/*****************************************************************************
 * FirstProject_Core0.c
 *****************************************************************************/

#include <sys/platform.h>
#include <sys/adi_core.h>
#include "adi_initialize.h"
#include "FirstProject_Core0.h"
#include <drivers/uart/adi_uart.h>
#include <services/pwr/adi_pwr.h>
#include <stdio.h>

/* UART driver memory */
uint8_t driverMemory[ADI_UART_UNIDIR_DMA_MEMORY_SIZE];

#define BAUD_RATE 19200u

int main()
{
	printf("TEST 1");

	/**
	 * Initialize managed drivers and/or services that have been added to 
	 * the project.
	 * @return zero on success 
	 */
	adi_initComponents();
	
	/**
	 * The default startup code does not include any functionality to allow
	 * core 0 to enable core 1 and core 2. A convenient way to enable
	 * core 1 and core 2 is to use the adi_core_enable function. 
	 */
	adi_core_enable(ADI_CORE_SHARC0);
	adi_core_enable(ADI_CORE_SHARC1);

	/* Begin adding your custom code here */

	/* UART driver handle */
	ADI_UART_HANDLE hDevice;

	/* driver API result code */
	ADI_UART_RESULT result;

	/* buffer which holds data to transfer over UART */
	uint8_t buffer[] = {'h','e','l','l','o','\n','\r'};

	ADI_PWR_RESULT pwr_result = adi_pwr_Init(0, 25000000);
	if (ADI_PWR_SUCCESS != pwr_result)
	{
		while(1);
	}

	printf("TEST 2");

	/* open the UART driver in Tx mode only */
	result = adi_uart_Open(0, ADI_UART_DIR_TRANSMIT, driverMemory, ADI_UART_UNIDIR_DMA_MEMORY_SIZE, &hDevice);
	if (ADI_UART_SUCCESS != result)
	{
		while(1);
	}

	/*
	 *  configure UART
	 *
	 * adi_uart_SetConfiguration()
	 * adi_uart_SetBaudRate()
	 * adi_uart_EnableDMAMode()
	 */

	result = adi_uart_SetBaudRate(hDevice, BAUD_RATE);
	if (ADI_UART_SUCCESS != result)
	{
		while(1);
	}

	result = adi_uart_SetNumStopBits(hDevice, ADI_UART_ONE_STOPBIT);
	if (ADI_UART_SUCCESS != result)
	{
		while(1);
	}

	result = adi_uart_SetWordLen(hDevice, ADI_UART_WORDLEN_8BITS);
	if (ADI_UART_SUCCESS != result)
	{
		while(1);
	}

	result = adi_uart_SetParity(hDevice, ADI_UART_NO_PARITY);
	if (ADI_UART_SUCCESS != result)
	{
		while(1);
	}

	 /* write data to the UART device using a blocking write */
	 result = adi_uart_Write(hDevice, buffer, sizeof(buffer));

	/* close the UART driver */
	result = adi_uart_Close(hDevice);

	return 0;
}

Top Replies

Parents Reply Children
No Data