Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.

jiwonoh's Content

There have been 7 items by jiwonoh (Search limited from 29-March 23)


By content type

See this member's

Sort by                Order  

#63294 How to read SoftwareVersion.BuildDate(in Device Capabilities) through code

Posted by jiwonoh on 29 June 2015 - 04:55 AM in Beta Firmware and Drivers

Dear

 

 

I tried to read SoftwareVersion.BuildDate in Device Capabilities function provided MFDeploy Tool.

 

I searched assemblies, but I cannot figure out which one provide it.

 

pic1.jpg

 

Regards,

Jiwon




#59850 ISR in interop

Posted by jiwonoh on 22 August 2014 - 02:33 AM in Netduino Plus 2 (and Netduino Plus 1)

About the issue.

 

 

For using ISR in interop, should follow "PK Convention" not "MDK Convertion" what I used.




#59791 ISR in interop

Posted by jiwonoh on 20 August 2014 - 06:52 AM in Netduino Plus 2 (and Netduino Plus 1)

@CW2

 

When you use your ISR handler, have you disabled/removed the one in the firmware? There will be a conflict - .NET Micro Framework does not have any support for hardware resource sharing/management, so one must be a little bit careful when adding custom functionality.

 

 

Surely, I disabled default one in PK source. I changed those with stub file which has no implementation.

CPU_INTC_ActivateInterrupt(g_STM32_UART_Irq[uartNum], STM32_USART_Interrupt0, 0);

 

GPIO ISR is used in STM32_GPIO_functions.cpp to handle pin interrupts, does not do anything with USART.

 

 

You're right. While I track the reference, I missed the right target.

 

 

 

 

Thanks.




#59787 ISR in interop

Posted by jiwonoh on 20 August 2014 - 12:24 AM in Netduino Plus 2 (and Netduino Plus 1)

Thanks, CW2

 

You should be able to hit a breakpoint in an ISR handler - if you can't, it can indicate it is never called (do you actually activate/enable it in your code?).

 

Right. I tested it with usart function in porting kit provided in official site. When I remove initialization code, related ISR handler is not accessible(ISR is registered in init part)

 

But my code is confirmed in native project(Keil), now I'm finding the problem.

 

 

What version of Netduino do you have? Are you developing a port for a new microcontroller? There is already USART ISR handler implemented in the firmware - you can use it as a reference for things needed to get it work (e.g. configure pins, enable peripheral clock, activate interrupt, setup USART module, use locks etc.).

 

I'm using my own board, and it has STM32F429. Many functions are based on netduino. I adopted it in a variety of cases and specification, confidential

 

 

 

Default PK use GPIO ISR handler for checking out the stream on usart. I will test and share results.

 

 

Jiwon




#59777 ISR in interop

Posted by jiwonoh on 18 August 2014 - 10:54 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi, all.

I'm trying to put usart funcion in interop. I almost did it following the guide as below:
http://blogs.msdn.co...ework-v3-0.aspx

I implmented send function and data stream can be transfered in C# application through the class I made. But when I send packet through usart, the board just freeze when it get the stream. I want to figure out what is cause, so I debug through Keil project. But in that code, ISR part cannot be accessed with debugger (I cannot hit break point in that area)

I'm using USART2 in my board. Other functions look like this: Made from "generate stubs..." and tested it works in simple case. I thought ISR called when it get flag, so I just put native source in .cpp.

I wonder if I want to use ISR in interop, is there any special way of?

Jiwon
UINT32 Usart::s_IsAvailable( CLR_RT_HeapBlock* pMngObj, HRESULT &hr )
{
	UINT32 retVal = 0;
	return retVal;
}

void Usart::s_Send( CLR_RT_HeapBlock* pMngObj, UINT32 param0, HRESULT &hr )
{

}

void USART2_IRQHandler(void)
{
	if( USART_GetITStatus(USART2, USART_IT_RXNE) )
	{
		char t = USART2->DR;
		if( (t != 'n') && (count < MAX_STRLEN) )
		{
			receiveBuffer[count] = t;
			count++;
		}
		else
		{
			//Not implemented yet
			count = 0;
		}
	}
}

 




#59669 Porting usart for receiving data

Posted by jiwonoh on 12 August 2014 - 01:59 AM in Netduino Plus 2 (and Netduino Plus 1)

Hi, all

I'm trying to solve stream-broken in usart through MF.

Through usart bus, 21760 bytes as speed of 250kbps should be transferred. When I tested with netduino based PK with large buffer(I modified RxQueue to receive all data), sometimes data is missing. Every time the index of missing is changing, so I think it is not related with logic in C# app.

Below is a part of netduino source related with USART.

 

void STM32_USART_Handle_RX_IRQ (int ComPortNum, USART_TypeDef* uart)
{   
	INTERRUPT_START;   
	char c = (char)(uart->DR); // read RX data   
	USART_AddCharToRxBuffer(ComPortNum, c);   
	Events_Set(SYSTEM_EVENT_FLAG_COM_IN);   
	INTERRUPT_END;
}
 

I thought it is related with AddCharToRxBuffer, so I used this test code in Keil with debugger.
(the length of data is fixed, so I used MAX_STRLEN for checking stream is finished)

 

 

?

 

void STM32_USART_Handle_RX_IRQ (int ComPortNum, USART_TypeDef* uart)
{
	INTERRUPT_START;
	if(cnt < MAX_STRLEN)
	{
		char c = (char)(uart->DR); // read RX data
		received_string[cnt] = (char)(uart->DR);
		cnt++;
	}
	else
	{
		for(int i = 0; i < MAX_STRLEN; i++)
		{
			USART_AddCharToRxBuffer(ComPortNum, received_string[i]);
			Events_Set(SYSTEM_EVENT_FLAG_COM_IN);
		}
		cnt = 0;
	}
	INTERRUPT_END;
}

When I confirm the data in received_string array while PC is hang in else condition, the data is different with original one.

Now I am suppose it is timing issue.
- Usart Interrupt Clock or
- Thread/Timer issue related with other core function or

I'm not expert in native and embedded, so I'm checking every module one by one. I wonder which part can be related with this issue.


P.S. I tested also native example, and it works. So this is not hardware problem.

 

 

Jiwon

 




#59668 Porting usart for receiving data

Posted by jiwonoh on 12 August 2014 - 01:58 AM in Netduino Plus 2 (and Netduino Plus 1)

Hi, all

I'm trying to solve stream-broken in usart through MF.

Through usart bus, 21760 bytes as speed of 250kbps should be transferred. When I tested with netduino based PK with large buffer(I modified RxQueue to receive all data), sometimes data is missing. Every time the index of missing is changing, so I think it is not related with logic in C# app.

Below is a part of netduino source related with USART.

 

 
void STM32_USART_Handle_RX_IRQ (int ComPortNum, USART_TypeDef* uart)
{
INTERRUPT_START;

char c = (char)(uart->DR); // read RX data
USART_AddCharToRxBuffer(ComPortNum, c);
Events_Set(SYSTEM_EVENT_FLAG_COM_IN);

INTERRUPT_END;
}

I thought it is related with AddCharToRxBuffer, so I used this test code in Keil with debugger.
(the length of data is fixed, so I used MAX_STRLEN for checking stream is finished)

 

 
void STM32_USART_Handle_RX_IRQ (int ComPortNum, USART_TypeDef* uart)
{
INTERRUPT_START;
if(cnt < MAX_STRLEN)
{
char c = (char)(uart->DR); // read RX data
received_string[cnt] = (char)(uart->DR);
cnt++;
}
else
{
for(int i = 0; i < MAX_STRLEN; i++)
{
USART_AddCharToRxBuffer(ComPortNum, received_string[i]);
Events_Set(SYSTEM_EVENT_FLAG_COM_IN);
}
cnt = 0;
}
INTERRUPT_END;
}

When I confirm the data in received_string array while PC is hang in else condition, the data is different with original one.

Now I am suppose it is timing issue.
- Usart Interrupt Clock or
- Thread/Timer issue related with other core function or

I'm not expert in native and embedded, so I'm checking every module one by one. I wonder which part can be related with this issue.


P.S. I tested also native example, and it works. So this is not hardware problem.

Jiwon





home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.