<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SillFsxa's Activities</title><link>https://community.arm.com/members/sillfsxa</link><description>SillFsxa's recent activity</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>STM32F4 DFP HAL Drivers Compatibility with ARM Compiler 6</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/47951/stm32f4-dfp-hal-drivers-compatibility-with-arm-compiler-6</link><pubDate>Sat, 31 Oct 2020 13:45:45 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:a7aa7ed7-a8a1-48c5-ac9a-64c231f55b33</guid><dc:creator>SillFsxa</dc:creator><description>&lt;p&gt;Just started to migrate to the ARM compiler 6 and I noticed __weak is incompatible language extension in this version and it needs to be written&amp;nbsp;__attribute__((weak)).&lt;/p&gt;
&lt;p&gt;In STM32F4 HAL Drivers and almost all of the ST MCU series, there are lots of functions that have __weak in their declaration while it is not supported in ARM compiler V6. As for ARM Compiler and the DFPs, I have installed the latest versions.&lt;/p&gt;
&lt;p&gt;Are we having a problematic kind of situation here?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Ask A Question I</title><link>https://community.arm.com/achievements/460ac7df-7ccc-4c42-a204-9e05eef3be09</link><pubDate>Sat, 31 Oct 2020 01:53:03 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:081c1062-9a81-4618-9c98-535ecb8b8cdb</guid><dc:creator /><description>Ask a question in a forum.</description></item><item><title>I keep receiving 0 from one of lm35 sensors</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/47945/i-keep-receiving-0-from-one-of-lm35-sensors</link><pubDate>Fri, 30 Oct 2020 19:22:36 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:413c42f3-a15d-4d14-b46c-4bdc5d85217a</guid><dc:creator>Ali_Kermani </dc:creator><description>&lt;p&gt;Hello everyone, I&amp;#39;m trying to read the temperature of two LM35 sensors and send them to my phone using HC06 bluetooth module. I&amp;#39;ve successfully received the temperature of one the sensors on my phone, but when I added the second sensor I received only 0. I checked my circuit connections and tried different adc channels, but still I keep receiving 0 from the second sensor. Interestingly when I use only one adc channel I receive the correct temperature, but when I use 2 adc channels I receive the correct temperature from one sensor and 0 from the other one. Moreover, in debug mode I receive 0 from one of the adc channels, so clearly the problem is with adc and not uart part of the code, I think&lt;/p&gt;
&lt;p&gt;Thanks in advance&lt;pre class="ui-code" data-mode="text"&gt;#include &amp;quot;Hardware.h&amp;quot;
#include &amp;quot;lpc17xx_gpio.h&amp;quot;
#include &amp;quot;lpc17xx_adc.h&amp;quot;
#include &amp;quot;lpc17xx_pinsel.h&amp;quot;
#include &amp;quot;lpc17xx_nvic.h&amp;quot;
#include &amp;quot;Delay_RIT.h&amp;quot;
#include &amp;quot;lpc17xx_uart.h&amp;quot;

uint16_t voltage1,voltage2, realTemp1=0,realTemp2=0,localTemp;
uint32_t total1=0,total2=0;
uint16_t countOfSum1=0,countOfSum2=0;
 volatile uint8_t flagOfTemp =0;
float calcVolt1,calcVolt2;	
void ADC_IRQHandler()
{
	if(ADC_ChannelGetStatus(LPC_ADC,ADC_CHANNEL_1,ADC_DATA_DONE)==0)
{
uint16_t temp1;
 

voltage1=ADC_ChannelGetData(LPC_ADC,ADC_CHANNEL_1);

calcVolt1=(voltage1*3.48)/4096;

temp1=calcVolt1*100;
total1+=temp1;
countOfSum1++;
	if (countOfSum1==100)
	{
		
		
		countOfSum1=0;
		realTemp1=total1/100;
		total1=0;
		flagOfTemp=1;
	}
	
	else
	ADC_StartCmd(LPC_ADC,ADC_START_NOW);	

} 
	if(ADC_ChannelGetStatus(LPC_ADC,ADC_CHANNEL_0,ADC_DATA_DONE)==0)
{
uint16_t temp2;
 

voltage2=ADC_ChannelGetData(LPC_ADC,ADC_CHANNEL_0);

calcVolt2=(voltage2*3.48)/4096;

temp2=calcVolt2*100;
total2+=temp2;
countOfSum2++;
	if (countOfSum2==100)
	{
		
		
		countOfSum2=0;
		realTemp2=total2/100;
		total2=0;
		flagOfTemp=1;
	}
	
	else
	ADC_StartCmd(LPC_ADC,ADC_START_NOW);	

}
	
	
}
uint16_t HW_ADC_Read1()
{
	  flagOfTemp=0;
		ADC_StartCmd(LPC_ADC,ADC_START_NOW);
	
    while(flagOfTemp==0);	
	   
	  return realTemp1;
}
uint16_t HW_ADC_Read2()
{
	  flagOfTemp=0;
		ADC_StartCmd(LPC_ADC,ADC_START_NOW);
	
    while(flagOfTemp==0);	
	   
	  return realTemp2;
}


void HW_Init()
{
 
	
PINSEL_CFG_Type adcpinsel;
PINSEL_CFG_Type uartpinsel;
UART_CFG_Type   uartConfig;
	
NVIC_SetPriorityGrouping(0x07);	
	
adcpinsel.Funcnum=PINSEL_FUNC_1;
adcpinsel.OpenDrain=PINSEL_PINMODE_NORMAL;
adcpinsel.Pinmode=PINSEL_PINMODE_TRISTATE;
adcpinsel.Pinnum=24;
adcpinsel.Portnum=0;
	
PINSEL_ConfigPin(&amp;amp;adcpinsel);
adcpinsel.Pinnum=23;
PINSEL_ConfigPin(&amp;amp;adcpinsel);

	
ADC_Init(LPC_ADC,200000);
ADC_IntConfig(LPC_ADC,ADC_ADINTEN1,ENABLE);
ADC_IntConfig(LPC_ADC,ADC_ADINTEN0,ENABLE);
ADC_ChannelCmd(LPC_ADC,ADC_CHANNEL_1,ENABLE);
ADC_ChannelCmd(LPC_ADC,ADC_CHANNEL_0,ENABLE);
NVIC_SetPriority(ADC_IRQn,NVIC_EncodePriority(0x07,0,1));	
NVIC_EnableIRQ(ADC_IRQn);

Delay_RIT_Init();	

uartpinsel.Funcnum=PINSEL_FUNC_1;
uartpinsel.OpenDrain=PINSEL_PINMODE_NORMAL;
uartpinsel.Pinmode=PINSEL_PINMODE_TRISTATE;
uartpinsel.Pinnum=2;
uartpinsel.Portnum=0;

PINSEL_ConfigPin(&amp;amp;uartpinsel);
uartpinsel.Pinnum=3;
PINSEL_ConfigPin(&amp;amp;uartpinsel);

uartConfig.Baud_rate=38400;
uartConfig.Databits=UART_DATABIT_8;
uartConfig.Parity=UART_PARITY_NONE;
uartConfig.Stopbits=UART_STOPBIT_1;

UART_Init(LPC_UART0,&amp;amp;uartConfig);
UART_TxCmd(LPC_UART0,ENABLE);
	
}
//main.c file 
#include &amp;lt;stdio.h&amp;gt;

#include &amp;quot;lpc17xx_gpio.h&amp;quot;
#include &amp;quot;lpc17xx_pinsel.h&amp;quot;
#include &amp;quot;lpc17XX_uart.h&amp;quot;
#include &amp;quot;lpc17XX_adc.h&amp;quot;

#include &amp;quot;Hardware.h&amp;quot;
#include &amp;quot;Delay_RIT.h&amp;quot;

int main()
{
	uint8_t buffstr [20];
	
	HW_Init();
	
	while(1)
{
	uint16_t temp1 = HW_ADC_Read1();
	uint16_t temp2 = HW_ADC_Read2();

  uint8_t len= sprintf( (char*)buffstr,&amp;quot;%u\n %u\n &amp;quot;,temp1,temp2);
	UART_Send(LPC_UART0,buffstr,len,NONE_BLOCKING);

	//send
	
	Delay_RIT_ms(1000);
	
}
	
}


&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>